Monthly Archives: April 2013

Making R go faster

If you need more than your for loops speeded up in R, you might want to see Noam Ross’s FasteR! HigheR! StrongeR! – A Guide to Speeding Up R Code for Busy People. It’s super practical and easy to understand.

An additional challenge for parentage analysis is that it requires exhaustive sampling and so is practical only over small spatial scales (less than 10 km) and low densities. Even extraordinary examples of this type of work include only about 1000 trees in isolated populations (Lesser & Jackson 2013). The continental distributions of dense coniferous forests do not lend themselves to these methods.

In which I master the art of scientific understatement

Slow for loops in R

When I wrote my first for loop ever (in R), it was a pretty exciting moment in my life. There was definitely some happy dancing. Some of my for loops were really fast, but others that seemed pretty similar to my eyes took a really long time. I had a hard time figuring out why. If you are in the same boat, I recommend reading this section of Thomas Girke‘s Programming in R manual. It’s much faster than the “trial-and-error with occasional advice from other R users” approach I took.