Blog Archives

Clegg vs Pleb: An XKCD-esque chart

October 2, 2012
By
Clegg vs Pleb: An XKCD-esque chart

I saw an interesting “challenge” on StackOverflow last night to create an XKCD style chart in R. A couple of hours later & going in a very similar direction to a couple of the answers on SO, I got to something that looked pretty good, using the sin and cos curves for simple and reproducible … Continue reading...

Read more »

Some new functions I’ve discovered in R

January 29, 2012
By
Some new functions I’ve discovered in R

I’ve been writing a fair amount of R recently and have been going through a good learning period, here are some functions that I’ve discovered (mainly plyr and reshape related) and thought I would share: merge_all is a good way to merge multiple different data frames, rather than multiple merge commands. The key thing is … Continue reading...

Read more »

R: Subsetting a list based on a condition

January 19, 2012
By
R: Subsetting a list based on a condition

Quite a handy couple of lines of code to subset a list in R to just those elements which meet a certain condition. Here’s an example to return only those elements of a list which are a certain class. Thanks to this StackOverflow answer.

Read more »

Making an R Package: Not as hard as you think

January 11, 2012
By
Making an R Package: Not as hard as you think

I’ve been writing functions in R for a while to do various things like talking to APIs, web scraping, model testing and data visualisation (basically thing which can get a bit repetitive!), but have always been slightly intimidated about turning those functions into a package, which I could then call using library (package-name). Note that … Continue reading...

Read more »