Pages (Desktop)

Pages (Mobile)


Apologies for lack of blog updates recently, I am pleased to say I recently started a new job researching glaciers and environmental change in the High Atlas, Morocco, which is keeping me busy! We have just launched a new website for the project, so please check it out to find out more!

As well as my new job role, I have also been working on a brand new project which I hope to reveal in the new year! Updates to this blog are coming in the new year, and will include a new R guide series for creating maps, and also a new guide series to using LaTeX for writing thesis and dissertations.

EPPC 2018 Dublin: Atlas cedar pollen geochemistry

If you're attending this years EPPC 2018 - please come along and check out my poster presentation on pollen geochemistry of Atlas cedar, and how it can be used to tell us about the climate and environment.

If you can't make the conference, or would like to know more details about this work, read on!

First, a little background information. Atlas cedar (Cedrus atlantica) is an endemic conifer tree found growing across Morocco in the Rif Mountains, Middle Atlas, and parts of the High Atlas. It is also found in Algeria in the Tell Atlas, and Aures Mountains. Cedar has been in the region for thousands of years, but it is threated by climate change, extreme drought and human activity - particularly logging and grazing.

Because of the tree's longevity, and because it is the only species of Cedrus growing in the region, it is an ideal species to study to learn about the environment and climate of the past. We can be sure that analysis of fossil cedar pollen (from lake sediment and peat sediment cores) in the region comes from Atlas cedar. Unlike for example, pine, where the pollen may be from several different pine species (although analysis of pine geochemistry can identify pollen to the species' level).

Cedar is also an early autumn (fall) pollinating species, which means the pollen develops during the summer months, and its geochemistry is influenced by summer conditions.

In a previous blog post, I discussed pollen geochemistry in relation to how it is used to tell us about solar UV-B levels. Check out the post to learn more.

This blog post will cover stable isotope analysis of Atlas cedar pollen, ongoing work looking at fossil cedar pollen, and describe a method for isolating cedar pollen without using traditional chemical treatments.

Interpolating gridded datasets in R: UV-B data

In my most recent published paper, I analysed the effects of incoming solar UV-B radiation on the geochemistry of Atlas cedar pollen, focused on the Middle Atlas Mountains in Morocco. The study area was relatively small, with sample sites fairly close together.

The UV-B data was obtained from the glUV: Global UV-B radiation dataset, which combines data from NASA's Ozone Monitoring Instrument (OMI) onboard the Aura spacecraft, into grid cells containing average erythemally weighted estimates of daily UV-B radiation. You can read full details of the methods used in the associated research paper (Beckmann et al. 2014) (Available open access).

Gridded datasets are an excellent source of data for doing global or macro-scale studies. However, if working in a relatively small area, you may find that your study area is covered by just a few grid cells due to the often low resolution of gridded data. And this can sometimes make it more difficult to carry out analysis.

To overcome the problem, you can interpolate the data to increase the resolution. After interpolation, the gridded data will go from looking like the image on the left, to looking like the image on the right, which is much more detailed for the study area.

Read on to find out how to do this in R!

How pollen geochemistry can tell us about historic UV-B levels

Pleased to see that my latest research paper is now available online at The Holocene. Thanks to all of my co-authors: Will Fletcher, Pete Ryan, Alistair Seddon, Roy Wogelius and Rachid Ilmen, and thanks to the reviewers for their feedback. The paper and all associated research data is available for free and is open access. The data can also be accessed for free from Mendeley Data:

This research investigates the pollen geochemistry of Atlas cedar, and what it could tell us about incoming ultraviolet-B radiation (UV-B) on historic timescales in North Africa.

So, what is pollen? what is pollen geochemistry? what is UV-B? and why is any of this important?

Read on to understand this research in plain English!

Walter and Lieth climate diagrams in R

Climate diagrams are useful tools which provide a visual summary of average climate conditions for a place over a specified period of time. This guide will explain the different parts of a Walter and Lieth climate diagram, and show you how to create one in R using the "climatol" package. This package provides a really quick and easy way to make good-looking Walter and Lieth climate diagrams. But, this guide will also show you how to create one from scratch (no packages needed!).

High resolution photos of Cedrus atlantica and Cedrus deodara pollen

Last year I published a paper on the pollen morphology of Cedrus atlantica (Atlas cedar) pollen. As part of this study I took several light microscope (LM) and scanning electron microscope (SEM) photos of the pollen grains.

Some of the photos were published as part of the paper which is available open access here:, although the photos were scaled down, and not all of them were published, including the ones for Cedrus deodara (Himalayan cedar).

A recent Twitter post talking about how researchers take loads of great photos, which are then scaled down for publishing inspired me to upload the originals.

So, I've now uploaded all the high resolution LM and SEM photos that were taken as part of this study, in their original and unedited form (.tif files) to Mendeley Data. You can find the photos here:

Please feel free to use the photos however you like!

Useful functions for manipulating text in R

R has some really cool little features to make life easier. A couple of really useful features for dealing with long text or character strings are abbreviate() and strtrim(). The first will automatically abbreviate character strings to a specified number of letters, and the second will trim a long character string to a specified number of letters. These functions can be really useful if you need to shorten text - for example, in plot axes or legends.

This quick guide will show you how to use both of these functions in R, and also take a look at paste() for further text manipulation.

Quick guide to annotating plots in R

R has powerful graphical capabilities, and its possible to create almost any kind of graph, chart or plot. It also has powerful annotation options, allowing you to write and draw all over your plot, using labels, shapes, highlighting, and more.

You might have previously created plots in R, and annotated them using a different graphic program (e.g. Photoshop, Corel Draw etc.). But, you could just do it all in R! This guide will show you some of the ways in which you can scribble on your plots, which can be useful for keeping notes, or to highlight certain features of your data...

Principal Components Analysis (PCA) in R - Part 2

In the second part of my guide for principal components analysis (PCA) in R, I additionally cover loadings plots, adding convex hulls to your biplots, more customisation options, and show you some more examples of PCA biplots created using R's base functionality...

Quick guide to pch symbols in R

R pch symbols

A quick guide to pch symbols in R, including: which symbols are available, how to use them in plots and how to style them by changing colours, size, and line widths.

A handy reference for pch!

Quick guide to line types (lty) in R

A quick guide to the different line types that are available to use in R, and how to use them. This guide will also show you how to create your own line type, and additionally covers line end styles (lend) and line join styles (ljoin).

A handy reference for lty, lend and ljoin!

Principal Components Analysis (PCA) in R

There is no shortage of ways to do principal components analysis (PCA) in R. Many packages offer functions for calculating and plotting PCA, with additional options not available in the base R installation. R offers two functions for doing PCA: princomp() and prcomp(), while plots can be visualised using the biplot() function. However, the plots produced by biplot() are often hard to read and the function lacks many of the options commonly available for customising plots.

This guide will show you how to do principal components analysis in R using prcomp(), and how to create beautiful looking biplots using R's base functionality, giving you total control over their appearance. I'll also show you how to add 95% confidence ellipses to the biplot using the "ellipse" package.

PhD thesis by publication: Thoughts and experiences

For anyone thinking about embarking on a PhD, or has recently started the journey, a common question that arises is what format will you choose to publish your thesis? Do you go down the "traditional" route, writing a monolithic piece of text, or opt for the "thesis by publication" route (also known as alternative format, or article thesis), where you publish journal articles "as you go".

What option you choose may ultimately result from what question you trying to answer, the subject you are doing, or by the options offered by your university. Your future career choice may also dictate the type of thesis you write. Thinking of an academic career? then "publish or perish" may sound familiar to you!

Having recently completed my PhD thesis by publication, I wanted to share my thoughts and experiences on this format. Admittedly, before I started my PhD, I hadn't even thought about the different options for the thesis, but it seemed like a no brainer to do it via publications. After all, no one will ever read it, right?

Pollen diagrams in R using rioja - Part 3

In the third part of this guide series, which looks at plotting pollen diagrams using the "rioja" package, I will show you how you can combine different plot styles into a single pollen diagram figure. Now, your pollen diagram (or other stratigraphic diagram) could consist of bar plots, line plots and/or silhouette plots, rather than just a single plot type...

Secure https connection now enabled for this blog

Hi all, just a quick message to say that secure https connections have been enabled on this blog. The blog is hosted on with a custom domain name, previously it was not possible to enable https using custom domains. However, a recent update (still in beta) has made this possible. All visitors should automatically be redirected to the secure web page. This may result in some broken links - please let me know if you come across any. Thanks!

Creating multi-panel plots and figures using layout()

Multi-panel plots and figures are used everywhere, especially in scientific papers to compare different graphs or datasets. And creating them has never been easier using R!

There are several functions and ways in which you can create multi-panel plots/figures, and in this guide I will show you how to use the layout() function (available in the base installation) to create them.

Pollen diagrams in R using rioja - Part 2

In the second part of this guide series, I will show you some additional options and "hacks" that you can use for plotting pollen diagrams using the "rioja" package in R.

Click read more for full details, and a step by step guide.

Pollen diagrams in R using rioja - Part 1

If you have ever needed to create a pollen or stratigraphic diagram, you'll know there are various ways to do this. And of course, it can be done in R! In this two-part guide series I will show you how to plot a pollen diagram using the "rioja" package in R. You can also use this guide to create other stratigraphic diagrams, for example, diatom diagrams. Read on for more...

RasterStacks and raster::plot

Following on from the previous guide looking at WorldClim data, in this guide I take a look at using RasterStacks to import WorldClim datasets. In the previous guide, we used RasterLayers to import the data, so what is the difference? A RasterStack is a collection of RasterLayers bundled together, or stacked into one object. If you're only dealing with a few RasterLayers, then a RasterStack might not be necessary. However, when the number of RasterLayers increase, it can be easier to work with RasterStacks.

For example, if you wanted to look at minimum, maximum, and mean temperature data, along with precipitation data from WorldClim, using RasterLayers would require you to create 48 separate objects. Using a RasterStack, you could instead create 4 objects containing all the data for each variable.

This guide will also take a look at some of the additional options you have when plotting RasterStacks and other raster objects. Did you know that when you plot a raster object in R using plot(), it actually invokes the raster::plot function, while standard objects (e.g. scatterplots) would invoke graphics::plot? The previous guide suggested you might want to plot a figure which includes separate plots for each month of the year, or you might want a minimum and maximum temperature plot? I'll show you how you can do this easily using RasterStacks and raster::plot.

Sources of climate data

In my recent guide series looking at extracting, analysing and plotting climate data using R, I focused on two sources of climate data: CRU and WorldClim. These datasets provide all kinds of climate data, at varying temporal and spatial resolutions. But, as mentioned in the last post, there are many more climate datasets available, with data for even more climate variables.

Unless you know exactly what you're looking for, finding the data you're after can be a bit of a struggle. This is where the Climate Data Guide from NCAR comes in! Described as: Data discovery guided by experts, this website lists almost 200 different climate datasets, providing information about the dataset, metadata, the strengths and weaknesses of the data, example figures, and links to download the data. An overview of the Climate Data Guide can be read on the about page or in this research paper

Here's an example from their guide for the CRU gridded datasets (Available from

Visit the Climate Data Guide for a look at more datasets.

Global climate datasets are not the only source of climate data. Raw station data is often available. Click read more to find out about climate station data available from NOAA, the Met Office, and the Environment Agency.

Extracting data and making climate maps using WorldClim datasets

In this guide, i'll show you another way in which you can get climate data, by using WorldClim global climate datasets. This guide will take you through all the steps for downloading, opening, extracting, and plotting the data using R.

I'll show you how you can make some good looking climate maps using WorldClim data, for anywhere in the world. And, the guide will also look at some of the differences between the WorldClim datasets and CRU datasets (we looked at this in earlier guides), and why you might choose to use one or the other.

Working with extracted CRU climate data

In my previous guide, I showed you how to download and extract precipitation and temperature climate data from CRU datasets. Now that you have the raw data - i'll guide you through some of the ways in which you can work with, and manipulate this data.

From grouping your sample sites, to calculating annual data or seasonal data, to defining a climate period and then calculating changes to conditions since this period to observe climate change trends. I'll also show you how to plot the data to create climate graphs for your sites.

Getting Climate Data

Have you ever needed weather information or climate data for a project you are working on, such as a dissertation or thesis? Depending on which part of the world you need data for, sometimes it can prove very difficult to obtain good reliable climate datasets. While some agencies make weather station data freely accessible e.g. NOAA, others may restrict access. You might also want to look at climate data on large or global scales, where obtaining data from individual agencies can become more complex.

Luckily, there are several global climate datasets available, which have done all the hard work of collating and processing the climate data into an easily accessible and consistent format.

In part one of this guide, I will show you how to obtain climate data from the Climate Research Unit (CRU) and extract only the data you need for your project using R. In part two of this guide (coming soon!), I will show you how you can manipulate this data, while part three will show you how to extract climate data from WorldClim datasets.

Getting Started with R: Introduction to R

Ever wanted to try R, but wasn't sure where to start? Or perhaps you are unsure of what R is and what it can do? This guide is designed to get you started with R and teach you the basics - showing you where to obtain R and introducing you to the R environment. It gives a quick overview of data structures and basic commands, and shows you where to get more help to develop your R skills.

The goal is to introduce you to the R environment, so you can become familiar with R, and can then start to experiment and perform your own data analysis with confidence.

NEW updated guide for 2021!


Welcome to my blog! Who am I and what is it about? I have recently completed a PhD in physical geography with a background in Quaternary Palynology and geochemical techniques – basically looking at climate and environment change. I am interested in how our environment has changed over time, and how this is related to climate – and the impacts that climate has on the environment. My research was focused on the environment of Morocco, looking specifically at Atlas Cedar trees in the Middle Atlas. You can read more about this on my publications and about me pages.

So what is this blog about? Throughout my PhD I spent a lot of time analysing data using R – R is a free open-source program for statistical analysis, and can also be used to create good-looking figures and maps. I used R for all of my analysis, creating maps and extracting climate data. R is really easy to use, although may appear daunting for newcomers.

This blog will have a focus on how to use R, with tutorials and guides for performing analysis related to environmental and climate science, which will be updated regularly. Other content will relate more generally to all aspects of environmental science, lab work, and guides for using LaTeX (for thesis writing), and other useful study tips I picked up along the way.

To kick off, I have written an introductory guide to using R, explaining the basics. Future guides will move on to more advanced topics, such as performing climate interpolation, but for now, if you have never used R, then check out my first guide to get started!