Category Archives: R

Ecologists: what we do vs. what we want people to think that we do

This occurred to me the other day while out working in the field for a day. I think back on all the photos I’ve posted of me doing rad stuff outside for work, like skiing through northern forests, flying around … Continue reading

Posted in graphics, R | Leave a comment

R code your Secret Santa exchange

Remember when everyone in the office/family would gather around and pull little pieces of paper out of a hat with names on them to decide who buys a secret Christmas gift for whom? Remember when people used to write on paper? … Continue reading

Posted in R, Uncategorized | Tagged , , , | Leave a comment

Space Invaders in R

So, for no particular reason except that it was kinda fun, I made some Space Invaders graphics in R. I even made the cool ‘Game Over’ text. Side note: this might be the first time that I’ve actually found the … Continue reading

Posted in graphics, R | Tagged , , , , , , , | Leave a comment

Cycling gear ratio calculator for R (or why you should just go buy a SRAM Eagle 1×12 group right now)

Don’t care about R functions? Fine then. Jump past all the code to my analysis of single ring cyclocross setups or to my analysis of SRAM’s new 1×2 Eagle group. It took the end of a bottle of Jägermeister Winterkräuter to finish this … Continue reading

Posted in R, Sports | Tagged , , , , , , , , , , , , , , | 4 Comments

Running pace and time calculator function for R

With an upcoming half-marathon, I went looking online for a good race time and race pace calculator (of which there are some good simple ones and some more interesting ones). But let’s face it. What I really wanted was an R function … Continue reading

Posted in R, Sports | Tagged , , , , , , , , , | 1 Comment

Spatial leave-one-out (SLOO) cross-validation

There are a variety of cross-validation (CV) methods to deal with things like spatial autocorrelation, including the spatial leave-one-out (SLOO) approach. This is essentially a normal leave-one-out method where the area around the withheld point is buffered in space to … Continue reading

Posted in R | Tagged , , , , , , , , , | Leave a comment

Re-scaling tricks in R

Not rocket science. Just parking this here for easy future access. R has the very useful scale() command for scaling vectors/matrices. This command takes a group of numbers, re-centring the mean to 0 and standard deviation to 1. Essentially it’s … Continue reading

Posted in R | Leave a comment