Skip to navigation

Archive for the 'R' Category

R: loops vs apply (vectorization)

Wednesday, February 10th, 2010

A helpful article in by Uwe Ligges and John Fox in R news 2008(1), pp 46-50, about loops vs. apply was just pointed out on R-help. I’ve uploaded it here (pdf).

My first RMySQL session

Thursday, January 21st, 2010

# ‘fai1’ is an empty MySQL database for which ‘mpromber’ has all privileges mycon


Wednesday, January 20th, 2010

Memo to self: I installed RMySQL using sudo aptitude install r-cran-rmysql because when I used install.packages(“RMySQL”) it asked my to specify the MySQL libraries and headers and whatnot and don’t know where they are.

Use R to help with lottery drawing

Thursday, January 7th, 2010

When you start using R, it can be confusing that if you assign something to an object you do not get visual feedback: x x [1] 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 You can exploit this fact for doing a quick-and-dirty lottery. Assume you have a […]

Nice R example from r-help

Thursday, November 5th, 2009

I don’t know the first thing about programming, but sometimes you see something and appreciate how elegant it is. This small solution from r-help is a good example. Someone wanted, given a vector c(‘p’,’p’,’t’,’t’,’t’,’p’,’k’,’t’) to produce NA NA 1 2 3 test