r

What R package do you use most?

What R package do you use the most and why do you use it? ...

Understandable documentation about R?

Does there exist understandable Free documentation for the R programming language, which is accessible to statistics-impaired people? The ideal documentation would include also motivation (an example) for using each statistical function. ...

[R] How to access the last value in a vector?

Yes people, even though I'm talking about the R Project for Statistical Computing, it can still require programming! Suppose I have a vector that is nested in a dataframe one or two levels. Is there a quick and dirty way to access the last value, without using the length() function? Something ala PERL's $# special var? So I would lik...

Worse sin: side effects or passing massive objects?

I have a function inside a loop inside a function. The inner function acquires and stores a large vector of data in memory (as a global variable... I'm using "R" which is like "S-Plus"). The loop loops through a long list of data to be acquired. The outer function starts the process and passes in the list of datasets to be acquired. I p...

Explain the quantile() function in R

I've been mystified by the R quantile function all day. I have an intuitive notion of how quantiles work, and an M.S. in stats, but boy oh boy, the documentation for it is confusing to me. From the docs: Q[i](p) = (1 - gamma) x[j] + gamma x[j+1], I'm with it so far. For a type i quantile, it's an interpolation between x[j]...

How to search for "R" materials?

"The Google" is very helpful... unless your language is called "R," in which case it spits out tons of irrelevant stuff. Anyone have any search engine tricks for "R"? There are some specialized websites, like those below, but how can you tell Google you mean "R" the language? If I'm searching for something specific, I'll use an R-specif...

How to test for the EOF flag in R?

Hi all, How can I test for the EOF flag in R? e.g. f <- file(fname, "rb") while (???) { a <- readBin(f, "int", n=1) } Thanks. ...

Sample Code for R?

Does anyone know a good online resource for example of R code? The programs do not have to be written for illustrative purposes, I am really just looking for some places where a bunch of R code has been written to give me a sense of the syntax and capabilities of the language? Edit: I have read the basic documentation on the main site,...

Books for learning the R language

I'm looking for resources to start exploring the R language (as was recommended in my question on Statistical Tools). I know there are some suggestions for basic online tutorials in this thread, but I'd like something a little bit more extensive. Any suggestions for good textbook like references, either online and in dead-tree form? ...

WCF Bindings - so many! How do I choose one?

We have an R Server (R is a programming language used in statistical analysis) that basically takes a script and a csv file, processes some data and returns results as text. I need to write a service on the R server so that .net clients (could be .Net Windows Forms, or ASP.Net) can connect to the R server, submit the script and CSV fil...

Is there an R package for learning a Dirichlet prior from counts data

I'm looking for a an R package which can be used to train a Dirichlet prior from counts data. I'm asking for a colleague who's using R, and don't use it myself, so I'm not too sure how to look for packages. It's a bit hard to search for, because "R" is such a nonspecific search string. There doesn't seem to be anything on CRAN, but ar...

Optimization packages for R

Does anyone know of any optimization packages out there for R (similar to NUOPT for S+)? Thanks ...

What are some good books, web resources, and projects for learning R?

I have a book called Statistics for Computer Scientists as well as my engineering statistics textbook, so I'm thinking about using various problems and examples in those to learn R, which is probably a good start. But can anyone recommend books and web sites that have information about R, especially if they are designed for people with s...

Thinking in Vectors with R

I know that R works most efficiently with vectors and looping should be avoided. I am having a hard time teaching myself to actually write code this way. I would like some ideas on how to 'vectorize' my code. Here's an example of creating 10 years of sample data for 10,000 non unique combinations of state, plan1 and plan2: st<-NULL p1<-...

Vectorize my thinking: Vector Operations in R

So earlier I answered my own question on thinking in vectors in R. But now I have another problem which I can't 'vectorize.' I know vectors are faster and loops slower, but I can't figure out how to do this in a vector method: I have a data frame (which for sentimental reasons I like to call my.data) which I want to do a full marginal a...

R language general question

Hello, I can't find it anywhere on the web (and I don't want to install it). Is the R language a compiled language? How fast does it run a pre-written script? Does it do any kind of compilation, or just execute instructions line by line? ...

Converting a localized date of the form 12-okt-2007

Hi, I have imported a time series with dates of the following format: test = c("11-Feb-01","12-Feb-01","01-Mai-08") This yields: > as.Date(test, "%d-%b-%y") [1] NA NA "2008-05-01" Since, May was translated it obviously takes locale into account. According to the docs, the %b should be the abbreviated month na...

Filtering data in R

I have a CSV of file of data that I can load in R using read.csv() Some of the data is missing, so I want to reduce the data frame down to set that consists entirely of non-missing data, i.e. if a NULL appears anywhere, I want to exclude that column and row from the filtered data set. I know I can probably do this fairly simply with th...

How do i deal with time intervals like 08:00-08:15

Hi, I would like to import a time-series where the first field indicates a period: 08:00-08:15 08:15-08:30 08:30-08:45 Does R have any features to do this neatly? Thanks! Update: The most promising solution I found, as suggested by Godeke was the cron package and using substring() to extract the start of the interval. I'm still...

What's the easiest way to install 100s of files in a Visual Studio setup project

I have a standard c# application that acts as a GUI front end for a an "R" statistics engine. "R" consists of approx 600 files in approx 50 different folders and can be "installed" on a machine through xcopy deployment. I would like to package up both the R engine and my c# gui into one setup.exe so that the user doesn't need to go and ...