Wednesday, 1 March 2017

Pretty graphs in R

I've lately been learning about macroecology and macroevolution, which consider ecology and evolution on big scales of time and/or space. There's a lot of debate about how comparable these big-scale processes are to little ones. There's lots of data on small-scale processes because they can be experimented on and studied within a timeframe that you can get money for, but macro isn't so easy. Most of what I've been doing has been modelling: taking big datasets and asking what things we can draw out and make predictions from, and whether those predictions make sense. And a very popular tool for modelling in biology is, of course, R.

After three years of being taught R, on and off, I'd hoped to be somewhat proficient now, but alas no. However, I did use instructions to make some very pretty graphs.

1. A species accumulation curve

This tracks species found by effort put in to find them. The dark line is the estimate, the light blob the confidence we have in it, so the more species found the more certain the estimate is. You'd expect to find more species if you look in more places; eventually pretty much all species will be found no matter how much effort you put in, so the graph plateaus. Mine hasn't quite plateaued yet, but it's close.

What's interesting is that, in real life, you'll never know the exact total number of species in your area, but looking at a species accumulation curve can give you a good estimate. It tells you whether future collectors should bring shoeboxes or shipping containers. Incidentally, this data is imaginary and based on Pokemon, which are traditionally collected in neither.


2. A radial phylogeny of fish

The lady who wrote this practical has a thing for colours that some may consider unpublishable.


3. Histograms of mildly interesting traits in primates

The relationship between adult body mass and gestation length in primates might not be especially interesting, but R's col=rainbow() sure is.


4. A horribly complicated boxplot

Still with the primate data, this looks at home range size by primate family. Only four names of fifteen fit. Looks like a boxplot dance party. A rare specimen of boxplot excitement.


5. Ancestral state reconstructions of the social structure of magical creatures

This analysis used a phylogeny to predict whether the common ancestors of all of these taxa (J. K. Rowling taxa) were more likely to be solitary or social. Mostly, I love the large number of tiny pretty pies. Tiny pies are great.


6. A textbook bad graph

A textbook bad graph.


7. A mean phylorate plot for diversification rate in marsupials

This basically summarises the average diversification rate for each group on the tree. This tree is of marsupials (with monotremes as the little outgroup at the bottom) but it's far too big to have readable tip labels. In conclusion, kangaroos are red hot.


8. The nine credible distinct shift configurations for diversification rate in marsupials

Gonna be honest, I don't remember what this means, but it would make a super pattern for shower curtains.

No comments:

Post a Comment