Brilliant answer in StackOverflow on improving code performance in R
stackoverflow.com