This is a brief guide for making maps in R using ggplot2 and sf, tailored specifically for showing high latitude regions effectively. The example data for this are points that show the distribution of two species of seal near the Antarctic peninsula.
We’ll download observation records for Weddell and Southern elephant seals from gbif through rgbif and coastline data from Natural Earth with rnaturalearth, and plot them with a nice equal-area Azimuthal projection. Working with a suitable projection can really show the location of this study area in context. Projection parameters come from the Projection Wizard web app, based on John P. Snyder’s selection guideline and implemented by the Cartography and Geovisualization Group at Oregon State University.
Load packages and download the seal observation data for Southern elephant seals and Weddell seals (querying only points for Chile, Argentina, and Antarctica, using their ISO codes and a semicolon to concatenate the query).
Now we coerce the data into simple feature objects, simply by specifying which variables hold the coordinates, and what projection they’re in. Here I decided to subset the data by longitude and latitude, before projecting the combined sf object and creating a buffered bounding box that is used for plotting later on.
Next, we load country and state polygon outlines from Natural Earth (a public domain map dataset) and project them.
We are ready to plot all these data as layers in a ggplot call, but to illustrate the use of ggimage and to add some flair to the final map, we can make a table with locations and urls for images that can be drawn over the plot. In this case, little pictures of the two seals drawn by geneticist Julia Saravia and hosted online.
Ready for plotting. sf does most of the work with the spatial objects. I made a few arbitrary choices for the colors and the plotting extent, mostly for aesthetics.