Introduction to the Grammar of Graphics with ggplot2 in R

December 28, 2009
By

A detailed introduction to the Grammar of Graphics as implemented in R with the data visualization library ggplot2. This talk was given by Harlan Harris to the NYC R Statistical Meetup on December 3, 2009.

Read more »

Example 7.19: find the closest pair of observations

December 28, 2009
By
Example 7.19: find the closest pair of observations

Suppose we need to find the closest pair of observations on some variable x. For example, we might be concerned that some data had been accidentally duplicated. We return the ID's of the two closest observations, and their distance from each other. In both languages, we'll first create the data, then sort it, recognizing that the...

Read more »

Estimated Net Worth of SoilWeb- Our Online Soil Survey

December 28, 2009
By

According to the excellent source code evaluation tool, SLOCCount, our online soil survey (SoilWeb) code is worth about $268,543 and would require about 2 years of development time to re-create from scratch with a single developer working full-time. This is a fairly close estimate, as I have been working (part-time) on this code-base for 3 years now...

Read more »

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 »

Beancounter minor bug fix release 0.8.9

December 23, 2009
By

Another small update to beancounter and just like the previous release due to changes in Perl's Date::Manip. It seems that Date_Calc now really wants a reference to store error codes, so we supply one. I also changed the FX code to use OandA ad there ...

Read more »

Beancounter minor bug fix release 0.8.9

December 23, 2009
By

Another small update to beancounter and just like the previous release due to changes in Perl's Date::Manip. It seems that Date_Calc now really wants a reference to store error codes, so we supply one. I also changed the FX code to use OandA ad there a...

Read more »

Beancounter minor bug fix release 0.8.9

December 23, 2009
By

Another small update to beancounter and just like the previous release due to changes in Perl's Date::Manip. It seems that Date_Calc now really wants a reference to store error codes, so we supply one. I also changed the FX code to use OandA ad there ...

Read more »

Compare performance of machine learning classifiers in R

December 23, 2009
By
Compare performance of machine learning classifiers in R

This tutorial demonstrates to the R novice how to create five machine learning models for classification and compare the performance graphically with ROC curves in one chart. For a simpler introduction, start with Plot ROC curve and lift chart in R. # ...

Read more »

R in India: The Hindu

December 23, 2009
By

The Hindu, a leading English-language newspaper in India, published an article on December 21 about doing research with open-source tools and R got a prominent mention: Though commercial statistical packages are popular among researchers, their licensing costs drive people away from them. In this context, R http://www.r-project.org, the open source/free statistical package, which is fast becoming the darling of...

Read more »

malapportionment in the U.S. Senate

December 23, 2009
By
malapportionment in the U.S. Senate

The 40 Republican senators currently in the U.S. senate represent 36% of the U.S population. See the graph below (click on the thumbnail for PDF). This is something I’ve been meaning to compute for a while now, mapping the cumulative distribution of senators’ ideal points onto the cumulative distribution of state population (each state counts

Read more »

The Life Scientists at FriendFeed: 2009 summary

December 23, 2009
By
The Life Scientists at FriendFeed: 2009 summary

It’s Christmas Eve tomorrow and so I declare the year over. My Christmas gift to you is a summary of activity in 2009 at the FriendFeed Life Scientists group. It’s crafted using R + Ruby, with raw data and some code snippets available. If you want to see the most popular items from the group

Read more »

RInside release 0.2.0

December 22, 2009
By

RInside, a set of convenience classes to facilitate embedding of R inside of C++ applications, was updated to release 0.2.0 over the weekend. Sources as well as binary packages are at CRAN; sources are also at my RInside page The biggest news is t...

Read more »

RInside release 0.2.0

December 22, 2009
By

RInside, a set of convenience classes to facilitate embedding of R inside of C++ applications, was updated to release 0.2.0 over the weekend. Sources as well as binary packages are at CRAN; sources are also at my RInside page The biggest news is that ...

Read more »

RInside release 0.2.0

December 22, 2009
By

RInside, a set of convenience classes to facilitate embedding of R inside of C++ applications, was updated to release 0.2.0 over the weekend. Sources as well as binary packages are at CRAN; sources are also at my RInside page The biggest news is t...

Read more »

Multilevel and Longitudinal Modeling in Stata

December 22, 2009
By

For my "off-task" reading I recent perused an excellent book on multilevel and longitudinal modeling in Stata by Sophia Rabe-Hesketh and Anders Skrondal. The second edition (which I read) has been updated by including several chapters providing an over...

Read more »

Visualizing Unemployment in Mexico

December 22, 2009
By
Visualizing Unemployment in Mexico

What has been the impact of the economic crisis on employment? And how has it affected the different regions of Mexico? To answer the questions the first step was to obtain the unemployment data from the Banco de Información Económica at the INEGI. ...

Read more »

CPP package: exposing C++ objects

December 22, 2009
By

I've just started working on the new package CPP, as usual the project is maintained in r-forge. The package aims at exposing C++ classes at the R level, starting from classes from the c++ standard template library. key to the package is the CPP f...

Read more »

Forecasting the weather with R

December 22, 2009
By
Forecasting the weather with R

The US National Centers for Environment Prediction (NCEP) produces weather forecasts for the entire world from a model that's updated every 6 hours. The data is made freely available, and with a couple of free tools to convert the data and R you can easily produce am unpdated global weather forecast like this (click to enlarge): (Check out the...

Read more »

Singapore, February 19-20: Computational Topics in Finance

December 21, 2009
By

With all of the winter snows in the US this weekend, a trip to equatorial climes sounds pretty good right about now. That makes this email announcement from Rmetrics leader Diethelm Wuertz all the more tempting: Conference on 'Computational Topics in Finance' February 19/20, 2010, National University of Singapore Dear R/Rmetrics Community, We would like to announce the first...

Read more »

Animation video of rgl in action

December 21, 2009
By

Duncan Murdoch just posted a youtube video presenting an animation clip of a 3d rgl object. Duncan even went further and wrote an explanation on how he made the video: here are the steps I used: 1.  Design a shape to be displayed, and then play with the animation functions to make it change over time.  Use play3d to do

Read more »