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: http://dx.doi.org/10.17632/f6fxxdgpxg.1

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 "iki.dataclim" 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: https://doi.org/10.1080/01916122.2017.1356760, 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: https://data.mendeley.com/datasets/fvcb2mm95f/1

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 https://www.benjaminbell.co.uk

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.