I'm using R to read in some data from a MySQL database using the RODBC package. The data is then processed and some results are sent back to the database. The problem is that the server closes the connection after about a minute due to inactivity, which is the time needed to process the data locally. Its a shared server, so the host wo...
I'm using R to visualize some data all of which is in .txt format. There are a few hundred files in a directory and I want to load it all into one table, in one shot.
Any help?
EDIT:
Listing the files is not a problem. But I am having trouble going from list to content. I've tried some of the code from here, but I get a bug with this...
Mine from today: qnorm() takes Probabilities and pnorm() takes Quantiles.
...
I'm trying to write a function that plots a ggplot facet_wrap plot over multiple pages. It's just a hack, as this feature seems to be on the ggplot2 feature to-do list. I do some small calculations to find the number of pages I'm going to need, the number of rows of my data.frame that I need per page etc. I'm pretty confident this all wo...
Hello, I'm new to R and I'm trying to create a .R script that will open up a .csv file of mine and compute some frequencies. There are headers in this file and the values associated with them are either 1,0,NA, or -4. What I want to do is go through each vertical row and then compute the frequencies of them. I'm sure this is an easy scri...
I am trying to run the HoltWinters procedure on panel data to come up with sales forecasts for a list of companies. My data frame has the fields "Company", "Year" and "Sales". I am interested in adding an extra column to this data frame that shows fitted sales obtained using HoltWinters.
For a single company, the exercise is trivial as ...
Hi, I'm trying to replicate a linear discriminant analysis output from SPSS in R, and I'm having difficulties to find a way to perform an m-box test.
The only thing I found was some code posted in a forum, to manually implement the process, but I was wondering if there is nothing for this purpose already incorporated in the language it...
Hi All,
Very new to Social Network Analysis and R (read a few introductions online, created a few graphs on my own) but I am very eager to learn different ways to apply it. That said, what are common significance tests applied to networks, and more specifically, if two network graphs are "statistically different?"
Any help/tutorials y...
I'd like to fix a package, but can't figure out how to edit it. I can download the source from R-Forge as a .tar.gz and unzip it. There is an "R" directory with the source and also a "tests" directory.
How do I include the sources in my own project to test my edits?
How do I run the tests? The tests each start with "library(blotter)...
Is it possible to row bind two data frames that don't have the same set of columns? I am hoping to retain the columns that do not match after the bind.
I am new to R but figure that there has to be a fairly quick way to do this.
Many thanks,
Brock
...
i have two spatial xyz file with different resolution
how can i contour a composition of both files
i like working with R or open source geographical systems like GMT
if u know of a different way of solving this i would be glad to listen
...
Hi,
I have a tab delimited file like
A B 0.5
A C 0.75
B D 0.2
And I want to convert it to a square matrix, like
A B C D
A 0 0.5 0.75 0
B 0 0 0.2
C 0 0
D 0
How can I go about it in R?
Thanks,
...
Dear all,
I am generating an automatically generated periodical report with Sweave. In order to create a nice header I use the fancyhdr package which works really well so far. Now, since my report is periodical I want to change the header dynamically without passing an argument to the function. That's why I wrote a little R function th...
My sysadmin installed RApache for me on our 64 bit Solaris box. I can access the RApacheInfo page here, indicating that the module was successfully installed. There is the following entry in the httpd.conf:
<Directory /websites/zbroom>
SetHandler r-script
RHandler brew::brew
</Directory>
which should require all files in the dir...
RODBC error in Revolution R 64bit on winxp64 bit connected to Oracle using a 64bit ODBC driver thru a DSN
library(RODBC)
db <- odbcConnect("oraclemiso",uid="epicedf",pwd="…")
rslts = sqlQuery(db, "select count(*) from FTRAuction")
Error in .Call(C_RODBCFetchRows, attr(channel, "handle_ptr"), max, buffsize, :
negative length vectors...
Thank you for your reading. I often find that I need to apply a function to slices of my data, and then bind the outputs. I usually build a loop for that purpose, but I am sure I am doing it wrong, and that in R I should be using a different way of thinking. Can you please help me learn a better way to do this?
With thanks,
adam
r...
I want to create a function that takes a dataset name and a package name and returns the dataset as data.frame. Here is my try
loadDataSet <- function(name, pkg) {
varname <- data(name, package=pkg)
return(get(varname[[1]]))
}
loadDataSet("acme", "boot")
However, this function fails. The problem seems to be, that the c...
R allows us to put code to run in the beginning/end of a session.
What codes would you suggest putting there?
I know of three interesting examples (although I don't have "how to do them" under my fingers here):
Saving the session history when closing R.
Running a fortune() at the beginning of an R session.
I was thinking of having an...
I don't think this has been asked yet, but is there a way to combine information of a list with multiple levels and uneven structure into a data frame of "long" format?
Specifically:
library(XML)
library(plyr)
xml.inning <- "http://gd2.mlb.com/components/game/mlb/year_2009/month_05/day_02/gid_2009_05_02_chamlb_texmlb_1/inning/inning_5....
Hi, how do I plot an area around a set of points on a map in R? e.g.
map('world')
map.axes()
p <- matrix(c(50, 50, 80, 100, 70, 40, 25, 60), ncol=2) # make some points
points(p, pch=19, col="red")
polygon(p, col="blue")
... which gives me a polygon with a vertex at each of the points, but it looks rather crappy. Is there any way to "...