Monthly Archives: October 2011

Using Sweave

October 8, 2011
By

If you use R and haven’t discovered Sweave then go and find out about it. It enables R code and plots to be incorporated into a document so the analysis and report can be combined together in a single document. … Continue reading →

Read more »

R Graph Gallery widget in R Bloggers

October 8, 2011
By
R Graph Gallery widget in R Bloggers

The R Bloggers website, maintained by Tal Galili, aggregates blogs (including mine) from many people of the R community. Tal and I have been wondering about how to tight R Bloggers with the gallery, supporting each other's website. To that extent...

Read more »

Risk, Return and Analyst Ratings

October 7, 2011
By
Risk, Return and Analyst Ratings

Today I want to discuss a connection between Risk, Return and Analyst Ratings. Let’s start with defining our universe of stocks : 30 stocks from Dow Jones Industrial Average (^DJI) index. For each stock I will compute the number of Upgrades and Downgrades, Risk, and Return in 2010:2011. I will run a linear regression and

Read more »

Because it’s Friday: Reviews of Random Digits

October 7, 2011
By

If you dig around enough on Amazon.com, you can find some pretty odd products (like the Badonkadonk tank now sadly unavailable). Attached to these products you can often find a new form of comedy: the funny Amazon review. The products that attract such attention can be hard to fathom: this gallon of milk has more than 1,000 reviews. (Sample:...

Read more »

All combinations for levelplot

October 7, 2011
By
All combinations for levelplot

In a previous post I explained how to create all possible combinations of the levels of two factors using expand.grid(). Another use for this function is to create a regular grid for two variables to create a levelplot or a … Continue reading →

Read more »

In case you missed it: September Roundup

October 7, 2011
By

In case you missed them, here are some articles from September of particular interest to R users. The deadline to enter the "R Applications" contest with $20,000 in prizes is October 31. The RHadoop Project, a new collection of open-source R packages from Revolution Analytics, makes it possible to write map-reduce jobs in R to analyze huge data sets...

Read more »

R Workshop: Reading in Large Data Frames

October 7, 2011
By

 One question I get a lot about how to read large data frames into R. There are some useful tricks that can save you both time and memory when reading large data frames but I find that many people are not aware of them. Of course, your ability to read...

Read more »

When Wellington meets the “animation” package

October 7, 2011
By
When Wellington meets the “animation” package

The “animation” package is great for creating .gif files (of course, it also produces video and flash files thanks to Yihui Xie). By using this package, I would like to show you a nice spot in Wellington, NZ. At this … Continue reading →

Read more »

FFT / Power Spectrum Box-and-Whisker Plot with Gggplot2

October 6, 2011
By

I have a bunch of time series whose power spectra (FFT via R's spectrum() function) I've been trying to visualize in an intuitive, aesthetically appealing way. At first, I just used lattice's bwplot, but the spacing of the X-axis here really matters. ...

Read more »

Visualizing Tables with plot.table

October 6, 2011
By
Visualizing Tables with plot.table

plot.table function in the Systematic Investor Toolbox is a flexible table drawing routine. plot.table has a simple interface and takes following parameters: plot.matrix – matrix with data you want to plot smain – text to draw in (top, left) cell; default value is blank string highlight – Either TRUE/FALSE to indicate if you want to

Read more »