Skip to navigation

Archive for the 'R' Category

R: watch out when comparing vectors using “==”

Friday, September 25th, 2009

This question was on the R-help mailing list today: I have a data frame “test”: test test$total [1] 7 7 8 8 9 9 10 10 to this: > rep(needed,length.out=length(test$total)) [1] 7 9 7 9 7 9 7 9 The two vectors just happen to coincide at test$total[1] and test$total[6]. The recycling is of course […]

How to install RGoogleDocs (on Ubuntu)

Monday, September 14th, 2009

RGoogleDocs is not available from CRAN, but from To install, sudo R, then install.packages(“RGoogleDocs”, repos = “”) RGoogleDocs requires RCurl, and will automatically install it. However, for me, this resulted in the error message: checking for curl-config… no Cannot find curl-config and RGoogleDocs was not installed. This is in fact in the RCurl FAQ. […]

Emacs with ESS and AucTeX on Windows

Monday, September 14th, 2009

I will have to use MS Windows for my new job, at least some of the time. I’ll put related posts in a new “MS Windows” category. If you use R, you most likely want ESS (Emacs Speaks Statistics) for your GNU Emacs. If you use LaTeX, you will also want AucTeX. I highly recommend […]

R: create several plots with automatic generation of filenames in a loop

Tuesday, September 8th, 2009

Found on I didn’t know about this way to make R automatically generate filenames for a series of plots: jpeg(“~/tmp/rplots/foo%02d.jpg”) for (i in 1:5) { plot(i,ylim=c(0,6)) } I’m actually not sure whether R does this, or the Linux shell.

R flashmob #2 at

Tuesday, September 8th, 2009

This just in from Dan’s Decision Science News: Tonight at exactly 18:04 UK time, login at, post three questions you always wanted to ask about R, make sure you tag them “R”, and possibly stick around to answer some questions and to vote for good questions and answers. Sign the guestbook. More details at […]