Category Archives: R

How to calculate percent from counts in R

Micropaleontologists and others often want to calculate percent from count data. From looking at archived data, I realise that what should be an easy process goes wrong far more often that it should (which is of course never). Yesterday, I … Continue reading

Posted in Data manipulation, R | 1 Comment

Package version control

One aspect of writing a manuscript that I find tedious is checking the versions of the R packages I used. So I wrote a small function to do this automatically. (I don’t use ​= as an assignment operator in my … Continue reading

Posted in R, Uncategorized | Leave a comment

Please archive assemblage data as counts not percent

A large fraction of the microfossil assemblage that has been archived on-line by palaeoecologists is percent data, often without the count sums, rather than the raw count data. This is unfortunate as some analyses need count data. Calculating percent from … Continue reading

Posted in R | Tagged | 1 Comment

The European Pollen Database meets SQLite

The European Pollen Database is a fantastic resource for palaeoecologists, storing pollen stratigraphies from across the continent. Getting the data into R for analysis is facilitated by the EPDr package. However, first you need to set up the database and … Continue reading

Posted in R | Tagged | Leave a comment

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

english::as.english

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