Year notes: 2015

Big year

Three really big things happened this year in my personal life:

  1. I herniated a disc in my back in February. This effectively put an end to any running and massively messed with my ability to sit and stand for periods of time. This is getting better, slowly.
  2. I got married. This has not changed my relationship, but it seems important to mention.
  3. I got a new job (well I will start a new job, soon). This extends my stay in the USA by 2 years (probably).

What did I work on (for money)?

This year (as with last year) I worked at the Centre for Research into Ecological and Environmental Modelling at the University of St Andrews. Nominally I was working on “improvements to distance sampling methodology and software”. If you don’t know what distance sampling is, you can look here for an explanation. CREEM is the best place I’ve ever worked – smart, supportive people who are both giant nerds and immensely practical. Moving to a new job means I will miss those people at CREEM who I really enjoy working with, especially the folks who are also working on distance sampling software: Len Thomas, Eric Rexstad and Laura Marshall.


I made a pretty big run at getting the first part of my book on distance sampling done. It’s available online: Practical distance sampling in R. The first part involved working on Distance2 (the “next generation” of distance sampling software) a lot (well, writing it from scratch), so it took a lot longer than I thought. I’d say I’m about half done, hopefully I can find time to do the other half in 2016.


For a while I’d been frustrated with the current state of distance sampling R software (most of which I am somehow responsible for). So, I threw-down my tools grumped and re-thought how things should work. This resulted in a talk at useR! 2015 outlining my thoughts on building (relatively) complex ecological models (terrifyingly, my session was chaired by Hadley Wickham, from whom I’d stolen most of my ideas).

Distance2 is really getting somewhere and hopefully I will be able to devote some time to this in my new position.


I also got tired of being unable to open Distance for Windows projects on my Mac, so I wrote a package to open up the Access database that lives within these projects, convert analyses within them to corresponding R code and then test the results.

This started out as a Saturday morning project (I think I’d initially given myself “until Elle has finished baking a cake” to get something working), but others took an interest and I actually ended up spending quite a lot of time getting things working.

Available on github

Duke course

Along with Jason Roberts and Eric Rexstad, I put together a course at Duke University for grad students, staff and professionals from around the world on spatial modelling of (particularly marine) wildlife survey data. I really enjoyed teaching the course, and from what I can tell the participants enjoyed it too. I’ve written about my reflections on giving the course here. Needless to say, it’s given me a lot to think about in terms of improving both my teaching and organisational skills.


I only got one paper published this year but it was a paper that Len and I had been working on since 2008 (as part of my masters thesis). This broke the previous CREEM record on “time from conception to publishing”. I am not very proud of this achievement, but I do like the paper:

I did get another paper accepted for publication, with my fine Portuguese colleagues:

and we’ve submitted the following with colleagues from NYU:

Hopefully 2016 will prove more fruitful when it comes to publications.

What did I work on (when I could have been working for money)?

I’m getting into small projects: completing something self-contained is really very satisfying. Within a few hours you can get somewhere useful and have folks using your work and providing feedback. Contrast this with the amount of time it takes from doing a survey, doing an analysis, writing up the results, writing a paper, hearing back from your coauthors, before you even get close to the peer review process.

So, in chronological order:


This was a very silly Twitter bot that makes tweets of the form

[[verb]] that [[noun]]

where the verbs are functions in R base and the nouns are data types. Thanks to the excellent cheapbotsdonequick this took basically no time to put together and has a “cult” (read: “small”) following. Somewhat perversely, it’s most popular tweet is:

quit that language


Noam made a new logo for R for cats:

The R for Cats logo

and credited the colourscheme to Then, Karthik and Brandon both implied a package of Beyoncé-inspired colour schemes would be useful.

Well, long story short… I downloaded all of the palette files (using a download helper), pulled the unique colours out of them, and (hacking code from Karthik’s wesanderson package) put together a package.

Beyonce colour schemes

Then my phone melted.

beyonce package tweet stats

Available on github.


I had the idea for a while that you should be able to use emoji in plots in R (and I wasn’t the only one!). So I decided to take an afternoon to build something that I thought would work. This was heavily influenced by the fact I’d worked on rphylopic earlier and had worked out how to get grid and base graphics working together. From there it was just a matter of working out how to build a geom in ggplot2 (which mainly involved copying and pasting code from other geoms). Unfortunately for me, the time I chose to build the package was just before the release of ggplot2 version 2, meaning that things didn’t work for everyone to begin with.

Finally, I was able to produce a very satisfying plot:

mtcats plotted with car emoji

Then my phone melted for a second time.

emoGG package tweet stats

Available on github.


Another silly Twitter bot based on a weird proposition from the UK Labour Party’s John McDonnell:

John McDonnell MP, being properly weird

At the time @kiehlmanniac was staying with me, and for some reason we thought it would be funny to construct tweets of the form:

We need a new economy. It's [[political ideology]], but [[political ideology]] 
with a(n) [[tablet name]].

Fortunately, cheapbotsdonequick and the Wikipedia pages Category:Political Ideologies and Comparison of tablet computers were there to help and the recipe only a little while to construct (with some pruning of the entries).


Just after Christmas I realised my recipe book was, in fact, me remembering the names of recipes and typing them into google. This seemed like a bad idea. Also, I like YAML. So I came up with a simple YAML/markdown-based way to store recipes and generate jekyll sites from them.

This means you can now recreate my family’s Christmas cake recipe (warning: boozy).

What did I add to?


In trying to prepare some graphics for a talk, I realised what I needed was a whale to move around. Fortunately the excellent phylopic exists to give people like me what they want: high quality silhouettes of animals. Also fortunately, I knew Scott had written rphylopic to access phylopic from R. Unfortunately at that point there was only support for putting pictures into grid graphics, not base R graphics. Taking a break from talks at useR!, sitting on a sunny set of steps in the Aalborg convention centre, I got to grips with gridBase and submitted the patch to Scott.

Available on github.


I contributed a patch to Rich FitzJohn’s stegasaur. The package itself allows one to encode data in image files (so-called steganography) – in Rich’s words “The aim is to be able to encode arbitrary R objects in cat pictures”.

Ross Mounce suggested:

Ross suggests making the change

This ended up with me writing a patch that enabled one to use a knitr hook to encode the code that generated a given figure in the image file generated (and a standalone function to do this for those not using knitr). So, now one can write the following:

# make a plot as a PNG file, but encode what generated it in the image
figuredout({plot(sample(100))}, "simpleplot.png")
# extract the information

this will produce:


Handy? Perhaps…

Available on github.

Where did I go?

This year I visited a bunch of new states and travelled for work and fun in the US and Europe.

Visiting the states

I had set myself the goal that at the end of 4 years living in the US (2012-2016), I would have visited all 50 states (where “visited” means “done a thing” in that state, not just passed through by train or car). I didn’t make it, but I did fairly well. Here is my map:

A map of the states I've visited

I still have some way to go. If you work at a stats/ecology department in a white state above: invite me to give a talk, I will definitely come!

How far?

Since I take photos when I visit places (about 2,145 photos in 2015) and these are (usually) geotagged, I can get a rough estimate of the distance I covered in 2015. First, another map:

A map of the world with the places I visited joined up

Just taking straight line distances between the (Web Mercator projected) points, I get about 101,730km. I didn’t take photos everywhere, I didn’t have GPS locations for every photo, I estimated the distances badly. It’s still a long way.

CREEM visit 2015

I visited my place of work for (roughly) 2 months this year. As usual, I had a great time. One of many highlights was getting celebrate the 10th anniversary of my first day of work at CREEM, all the way back in 2005 as an undergraduate summer student.

To celebrate, by first officemate Ali and I made a cake depicting the “Island of No Maths” diagram Ali had drawn on the whiteboard, that appears to have been preserved by office inhabitants since:

The Island of No Maths

The Island of No Maths is where you go when there is “too much maths” and you need a break.

The cake:

The Island of No Maths cake!

Who did I meet?

I’ve now met some 157 of the combined 764 followers/followees I have on Twitter. I’m not sure exactly how many I met this year, but it was a lot. Without a doubt, everyone I’ve met from Twitter has been a fun person! I recommend meeting people from Twitter!

Here they all are:

(Code to generate this is in this gist.)

(Did I miss you?! I’m very sorry! Toot me and I’ll fix this!)

What’s next?

President Bartlet, explaining what's next

As of January 4th, I am going to be working at NOAA’s Northeast Fisheries Science Centre in Woods Hole, MA. I’m probably going to be spending a lot of time working on integrating data from lot of different places to try to build models so we can get a better idea of where North Atlantic Right Whales (Eubalaena glacialis) are and what they’re doing.

They look like this:

That’s all for now…

Hopefully in 2016 I can continue to: meet people from the internet, work on (and complete!) small projects and do some more travelling, while at the same time doing some interesting and useful science. Until next year…

Other posts

Year notes: 2015

Reflections on teaching "Spatial models for distance sampling data"