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 in helicopters, building cool stuff on glaciers, and the like. And then I think about all the photos I haven’t posted of me sitting at my desk (the number is non-zero, but just)…

Ecologist Pie Chart

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? And wear fancy hats? Ah, the good ol’ days.

These days, we use sophisticated algorithms for just about everything, so why not for making our Secret Santa lists?  Continue reading

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

Space Invaders in R

space_invaders_flyer_1978So, 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 “green” colour useful.

There’s no analysis here, no fancy statistics, not even any real key message. Just some number lists that make some pixelated images to remind you of your 80s upbringing.

If there’s one redeeming feature here, it’s the (brute force) code to get a vector of pixel values to convert to a matrix and plot properly. This was a bit trickier than expected (not using the raster package) and involves some odd reversing and transposing of the values. I’m open to a better solution, as I need to do this now and then for, you know, actual work. Continue reading

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

Some of my favourite infographics

I have a real love of “infographics” (aside: probably the best new word of the last decade…or, uh, five decades), which are basically the “pop” version of scientific figures with no peer review (and no journal colour charges!). Here are some of my favourites. I’ll add to it as I find more.


Continue reading

Posted in graphics, Uncategorized | 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 off, but here it is. In the spirit of the incogitable Sheldon Brown (whose name will come up anytime I need an authoritative word) I offer a simple gear ratio calculator function for the R programming environment. I also include two case studies at the end that look at 1) single vs. double ring cyclocross setups and 2) SRAMs new Eagle 12-speed group. 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 but I couldn’t find one out there. So I made a couple functions that maybe I’ll package up and post to CRAN someday. In the meantime, here they are. 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 remove effects of residual autocorrelation (RAC). Continue reading

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