Monthly Archives: December 2009

Capture system commands as R objects with system(…, intern=T)

December 28, 2009
By

Just discovered this very handy R command to capture the output from a system command as an R object.  I wanted to use R to read in the output from another program (PLINK) and do some processing on each output file. Of course if the files are named sequentially (plink1.out, plink2.out, plink3.out, etc.) this would be simple with a...

Read more »

Video: Visualizing data in R using ggplot2

December 28, 2009
By

At the most recent New York R User Group meetup, the topic was creating graphics in R with the ggplot2 package. Drew Conway's talk, "Making pretty pictures with ggplot2" gave several practical examples of visualizing data with ggplot2 and is well worth checking out: You can follow along with Drew's slides, which are downloadable from his blog. (Update: you...

Read more »

Visualizing Data in R with ggplot2

December 28, 2009
By

Drew Conway presents a brief talk on how to visualize data in R with ggplot2 at the NYC R Statistical Meetup on December 3, 2009.

Read more »

SQL group by in R

December 27, 2009
By
SQL group by in R

The R statistical computing environment is awesome, but weird. How to do database operations in R is a common source of questions. The other day I was looking for an equivalent to SQL group by for R data frames. You need this to compute summary statist...

Read more »

Merry Christmas using R

December 25, 2009
By

Yihui creates an Christmas greeting using R: See the R code to create an animated message in Flash here: Keep on Fighting: Merry Christmas Using R

Read more »

Because it’s Christmas: Microbe Mario

December 25, 2009
By
Because it’s Christmas: Microbe Mario

He's no Father Christmas, but he is dressed in festive red and green, and he's made of bacteria. This image, Mario, was submitted to the 2009 international Genetically Engineered Machine (iGEM) competition by Team Osaka from the nanobiology laboratories at the University of Osaka, Japan. They genetically engineered bacteria to express fluorescent proteins and carotenoid pigments to create works...

Read more »

Another Visualization of Unemployment

December 24, 2009
By
Another Visualization of Unemployment

One of the problems with choropleths is that, as explained by Hadley Wickham in this presentation, big states tend to draw more attention because of their size, but they also tend to have a low population Density. For example, Mexico City, the capital ...

Read more »

Merry Christmas Using R

December 24, 2009
By

Life should be fun. I saw a post in R-help list saying Merry Christmas to other useRs, and I followed up by some R code which can produce a naive animation like this: Here is the code to generate the above Flash animation with shining Christmas: library(animation) saveSWF({ n = length(speed <- runif(angle <- runif(x

Read more »

Error : .onLoad failed in ‘loadNamespace’ for ‘RWeka’

December 24, 2009
By
Error : .onLoad failed in ‘loadNamespace’ for ‘RWeka’

After installing Weka/RWeka in R, you may get this error if you try to load RWeka in the same session: require(RWeka) Cannot create Java virtual machine (-4) Error : .onLoad failed in 'loadNamespace' for 'RWeka' Solution: Just close R and re-open it. Cause: Apparently the installation requires some initialization. Tested on R 2.10.1 on Windows

Read more »

A web-based graphics application based on R

December 24, 2009
By
A web-based graphics application based on R

FlowingData recently took a look at Jeroen Ooms' latest web-based statistical tool based on R. We've looked at his tools for random-effects models and finance visualizations before, but this one is a more general tool for creating graphs from data sets using the ggplot2 package. It's pretty slick. All you need to do is upload a data set (in...

Read more »