Blog Archives

R and the last comma

March 31, 2013
By

In R, every comma matters. When creating a vector, c(1, 2, 5) will do the right thing, but add one unfortunate comma and c(1, 2, 5,) will greet you with a deadly Error in c(1, 2, 5, ) : argument 4 is empty. Other languages like Perl are less strict when defining basic data structures: having a comma after...

Read more »

Search and replace: Are you tired of nested `ifelse`?

January 6, 2013
By

It happens all the time: you have a vector of fruits and you want to replace all bananas with apples, all oranges with pineapples, and leave all the other fruits as-is, or maybe change them all to figs. The usual solution? A big old nested `ifelse`: ...

Read more »

How I cracked Troyis (the online flash game)

November 11, 2012
By
How I cracked Troyis (the online flash game)

Troyis™ is an addictive online flash game where you move a chess knight through increasingly difficult puzzles. After hours and hours of playing, sometimes late into the night, I decided I'd waste even more of my time and write a little program tha...

Read more »

Optical Art with R

July 16, 2012
By
Optical Art with R

Last week, in a post entitled Bridget Riley exhibition in London, the author Markus Gesmann wrote an R script reproducing one of Riley's famous art pieces: Movement in Squares.This reminded me of my own first "brush" with Op art. It was in art class ye...

Read more »

A gallery view for Craigslist

May 1, 2012
By
A gallery view for Craigslist

As much as I love Craigslist, I sometimes find the interface a bit limited. My biggest wish? That there was an option for showing the search results as an image gallery, like eBay has. This could prove quite useful for browsing things like antiques,...

Read more »

The 50 most used R packages

April 5, 2012
By
The 50 most used R packages

Ask anyone what makes R a great language, one argument that often comes back is its very active community. Proof is the impressive number of packages contributed by developers from all horizons and backgrounds. The CRAN website alone lists 3,725 p...

Read more »