Category Archives: R

OxCal and R

OxCal is perhaps the most powerful of the three main Bayesian age-depth modelling procedures, with many many options and the potential for building far more complicated than your typical palaeolimnologist needs to use. Unlike Bchron and Bacon, OxCal is not … Continue reading

Posted in Age-depth modelling, R, Uncategorized | Tagged | Leave a comment

ggplot2 maps with inset

Lots of students want maps showing their field sites for their thesis. Several have come to me with code they found on the internet but couldn’t get to work. The problem is that the plotting package ggplot2 has evolved since … Continue reading

Posted in R | Tagged | 7 Comments


It is conventional to write small integers as words rather than figures in text, especially if they are at the start of the sentence. This caused me some grief with rmarkdown, which I have started using for presentations, papers and … Continue reading

Posted in R | Tagged | 1 Comment

Don’t get attached to attach()

When data are imported into R it generally arrives as a data.frame, a type of object that contains named columns. We often want to access the contents of each column which can be done with the dollar or square-bracket notation. … Continue reading

Posted in R | Tagged | Leave a comment

Falling for ggplot2

I spent a long time resisting the lure of ggplot2. I was proficient with the plotting functions in base graphics; why did I need to learn an entirely new graphics system? Yes, getting up colour ramps could be a real … Continue reading

Posted in EDA, R | Leave a comment

More maps in R

It was perhaps inevitable: as soon as I had shown the delegates at an R workshop in Tallinn that maps of Estonia could now be drawn with the maps package, they wanted to know how to project maps, add site … Continue reading

Posted in R | Tagged | 3 Comments

Updated map in R maps package

The maps package in R plots very nice maps at global to regional scales. The problem with maps was that it used a 1990 map of national borders: slightly awkward when plotting maps covering countries that were once part of, … Continue reading

Posted in R, Uncategorized | Tagged