Rcpp 0.8.3

June 29, 2010
By

A new version 0.8.3 of Rcpp is now CRAN and in Debian. It comes about three weeks after the 0.8.2 release. And even though we promised to concentrate on documentation, it contains a raft of new features: The addition of what we dub Rcpp sugar: some ...

Read more »

Rcpp 0.8.3

June 29, 2010
By

A new version 0.8.3 of Rcpp is now CRAN and in Debian.It comes about three weeks after the 0.8.2 release. And even though we promised to concentrate on documentation, it contains a raft of new features:The addition of what we dub Rcpp su...

Read more »

Analyze Gold Demand and Investments using R

June 29, 2010
By
Analyze Gold Demand and Investments using R

After the recent foray into stock analysis using quantmod, I thought it worthwhile to mention that the library can be used to analyze a wide variety of investments, including precious metals.  It is also worthwhile to mention that there are other ...

Read more »

Entropy augmentation the modulo way

June 29, 2010
By
Entropy augmentation the modulo way

Long before I had heard about the connection between entropy and probability theory, I knew about it from the physical sciences. This is most likely how you met it, too. You heard that entropy in the universe is always increasing, and, if you’re like me, that made very little sense. Then you may have heard

Read more »

Tips for managing memory in R

June 29, 2010
By
Tips for managing memory in R

R is an in-memory application, so every new object you create takes up RAM. (Yes, there are ways around that, but that's a topic for another article.) If you're working on a small machine (say, a 32-bit Windows system with 1Gb of RAM or less) you might need to be careful with the object you create. This StackOverflow question...

Read more »

Sweave.sh in Eclipse-StatET

June 29, 2010
By

Sébastien Bihorel sent the following instructions on how to use my sweave.sh shell script in Eclipse-StatET.1- First, you need to know the path to your TEXINPUTS settings. Type R CMD env |grep TEXINPUTS in a shell. In my installation (opensuse 11.2), the shell returned the followingTEXINPUTS=.::/usr/lib/R/share/texmf:2- Edit your .bashrc file (located in your home directory) and add...

Read more »

Sweave.sh in Eclipse-StatET

June 29, 2010
By

Sébastien Bihorel sent the following instructions on how to use my sweave.sh shell script in Eclipse-StatET.1- First, you need to know the path to your TEXINPUTS settings. Type R CMD env |grep TEXINPUTS in a shell. In my installation (opensuse 11.2), the shell returned the followingTEXINPUTS=.::/usr/lib/R/share/texmf:2- Edit your .bashrc file (located in your home directory) and add...

Read more »

Analyze Twitter Data Using R

June 28, 2010
By
Analyze Twitter Data Using R

Twitter data available through its API provides a wealth of real time information.  This article demonstrates a graph of user relationships and an analysis of tweets returned in a search using R.  Keep in mind, Twitter has announced that basi...

Read more »

Second year of entries!

June 28, 2010
By
Second year of entries!

Hello, readers new and old!We started adding examples a year ago, in advance of the book's publication. To mark the occasion, we're closing chapter 7 and starting chapter 8 next week. We've crafted a listing of all entries from the first year and mad...

Read more »

Bootstrapping the latest R into Amazon Elastic Map Reduce

June 28, 2010
By
Bootstrapping the latest R into Amazon Elastic Map Reduce

I’ve been continuing to muck around with using R inside of Amazon Elastic Map reduce jobs. I’ve been working on abstracting the lapply() logic so that R will farm the pieces out to Amazon EMR. This is coming along really well, thanks in no small part to the Stack Overflow community. I have no

Read more »

How to peg 7 cores with doSMP

June 28, 2010
By
How to peg 7 cores with doSMP

Statistics PhD student Nathan VanHoudnos has an 8-core laptop, and by his own admission, takes "an almost unhealthy pleasure in pushing computer to its limits". It seems like he's found an outlet for this passion with the new doSMP library included with Revolution R, that allows him to use all his processors for some gnarly simulations in R:...

Read more »

Comparing 2010 and 2007 Arctic Sea Ice Extent Trends

June 28, 2010
By
Comparing 2010 and 2007 Arctic Sea Ice Extent Trends

See my Arctic Update Page for daily updates on Arctic Sea Ice Extent In this post I present a chart that tracks the daily Arctic Sea ice Extent (SIE) for 2007 and 2010. I chose 2007 as the comparison year … Continue reading →

Read more »

Plot Multiple Time Series using the flow / inkblot / river / ribbon / volcano / hourglass / area / whatchamacallit plots ~ blue whale catch per country w/ ggplot2

June 27, 2010
By
Plot Multiple Time Series using the flow / inkblot / river / ribbon / volcano / hourglass / area / whatchamacallit plots ~ blue whale catch per country w/ ggplot2

Ever since I first looked at this NYT visualization by Amanda Cox, I’ve always wanted to reproduce this in R. This is a plot that stacks multiple time series onto one another, with the width of the river/ribbon/hourglass representing the strength at each time. The NYT article used box office revenue as the width of

Read more »

Another harmonic mean approximation

June 26, 2010
By
Another harmonic mean approximation

Martin Weinberg posted on arXiv a revision of his paper, Computing the Bayesian Factor from a Markov chain Monte Carlo Simulation of the Posterior Distribution, that is submitted to Bayesian Analysis. I have already mentioned this paper in a previous post, but I remain unconvinced of the appeal of the paper method, given that it

Read more »

Weekend art in R (Part 2)

June 26, 2010
By
Weekend art in R (Part 2)

I put together four of the best looking images generated by the code shown here: # More aRt par(bg="white") par(mar=c(0,0,0,0)) plot(c(0,1),c(0,1),col="white",pch=".",xlim=c(0,1),ylim=c(0,1)) iters = 500 for(i in 1:iters) { center = runif(2) size = 1/rbeta(2,1,3)   # Let's create random HTML-style colors color = sample(c(0:9,"A","B","C","D","E","F"),12,replace=T) fill = paste("#", paste(color[1:6],collapse=""),sep="") brdr = paste("#", paste(color[7:12],collapse=""),sep="")   points(center[1], center[2],

Read more »

Stock Analysis using R

June 26, 2010
By
Stock Analysis using R

Want to do some quick, in depth technical analysis of Apple stock price using R? Theres a package for that!The Quantmod package allows you to develop, testing, and deploy of statistically based trading models.  It provides the infrastructure for d...

Read more »

Read Compressed Zip Files in R

June 25, 2010
By
Read Compressed Zip Files in R

One of the great things that I am learning about R is that it is really powerful as a data management tool.  I just found how to unzip files.  I could use Python for this in SPSS, but it just feels like it is more natural to do in R.  Of course, you have to

Read more »

Because it’s Friday: Insect sex

June 25, 2010
By

Birds do it, bees do it. But the bees and their insect brethren definitely do it in a more interesting way. Don't believe me? Check out Isabella Rosselini's description of bee sex and the other videos in her educational "Green Porno" series. It's fascinating stuff. For some light summer reading, I also recommend Olivia Judson's "Dr. Tatiana's Sex Advice...

Read more »

Pollution from the BP oil spill

June 25, 2010
By
Pollution from the BP oil spill

There's been a lot of talk about the slicks and plumes of oil from the Deepwater Horizon disaster, but how does the presence of that oil translate into measurable pollution in the air, water, and sediment? The EPA is now releasing pollutants and making the data available for analysis. Because the data are online, it's a simple process to...

Read more »

ASCII Scatterplots in R

June 25, 2010
By
ASCII Scatterplots in R

I really like R‘s stem function, it creates a stem-and-leaf plot right in the R console, no fancy graphics devices required! In a recent R-help post, Ralf Bierig presented a very nice ASCII scatterplot representing two densities. Unfortunately, I don’t know of any R function that will generate this type of plot, but I will

Read more »

R Commander – two-way analysis of variance

June 25, 2010
By
R Commander – two-way analysis of variance

Two way analysis of variance models can be fitted to data using the R Commander GUI. The general approach is similar to fitting the other types of model in R Commander described in previous posts. Fast Tube by Casper The “Statistics” menu provides access to some analysis of variance models via the “Means” sub-menu:Multi-way ANOVA – the

Read more »

R Commander – one-way analysis of variance

June 25, 2010
By
R Commander – one-way analysis of variance

One way analysis of variance models can be fitted to data using the R Commander GUI. The general approach is similar to fitting the other types of model in R Commander described in previous posts. Fast Tube by Casper The “Statistics” menu provides access to some analysis of variance models via the “Means” sub-menu:One-way ANOVA – the

Read more »

Surf

June 25, 2010
By

A new R user group has launched in Sydney. It aims to bring together both experienced R users and complete beginners. The forum will meet monthly with talks on a wide range of subjects exploring all of the facets of this powerful tool.

Read more »

Graphing Twitter friends/followers with R (updated)

June 24, 2010
By

Edit: And here is an update of the update, this one contributed by Kai Heinrich. Here’s an updated version of my script from last month, something I’ve been meaning to do for a while. I thank Anatol Stefanowitsch and Gábor Csárdi for improving my quite sloppy code. # Load twitteR and igraph packages. library(twitteR) library(igraph)

Read more »

Why Learn R? It’s the language of Statistics

June 24, 2010
By

In the Introduction to his book “R for SAS and SPSS Users” (Springer 2009) Robert Muenchen offers ten reasons for learning R if you already know SAS or SPSS. All ten reasons say something important about R. However, his fourth reason: “R’s language is more powerful than SAS or SPSS. R developers write most of their analytic methods using...

Read more »

World Bank API R package available!

June 23, 2010
By
World Bank API R package available!

In previous posts I demonstrated R plots created using World Bank Data through their API.  The following is a much nicer example of what is possible.  Many thanks to Vincent Arel-Bundock for sharing his work to make the World Bank D...

Read more »

R Commander – logistic regression

June 23, 2010
By
R Commander – logistic regression

We can use the R Commander GUI to fit logistic regression models with one or more explanatory variables. There are also facilities to plot data and consider model diagnostics. The same series of menus as for linear models are used to fit a logistic regression model. Fast Tube by Casper The “Statistics” menu provides access to various

Read more »

How to: Debug in R

June 23, 2010
By

Revolution Analytics is proud to sponsor the New York R User Group. The last meeting was on the theme of debugging in R, and some videos of the talks are now available at the Video Rchive. Jay Emerson have a talk on Basic debugging in R and Harlan Harris dived deeper on advanced debugging techniques. Also presenting were Peter...

Read more »

Scoping Bugs

June 22, 2010
By

I ran a across a strange bug in R recently. Like all the best programming languages, R treats functions as first class objects. That is to say that functions can be passed as arguments and return values from functions, named as variables, and, while not part of the strict definition of first class...

Read more »