Overview This is the second part of the introduction to ggplot2, written for the palaeobiology master students at Uni Erlangen. You can find the first part on the evolvED homepage.
Here, we will dive a little bit deeper into ggplot2 and see how we can modify the default output of ggplot. In the end you will be able to personalise a plot to fit your needs, enabling you to produce publication ready plots within the R environment.
Overview This document will give you a short introduction to the wonderful world of ggplot2. Before you fight your way through this document, take a look at some of the best visualisations from 2019 produced with ggplot. Just think of the struggle to produce those in base R.
Here, we will deal with the basics and the most important aspects of the package. Each constituent of a graphic is explained shortly and a few examples will hopefully demonstrate how to use the learned input.
Although the subsample() function was developed for estimating turnover rates and diversity changes over multiple time intervals, it was adapted to execute subsampling on single samples.
Let’s say that we have a sample of 20 species, where species have the following number of specimens:
# counts of specimens counts <- c(35,19,13,9,6,4,2,2,2,2,2,2,2,1,1,1,1,1,1,1) Preparing data The current version of divDyn can only accept extended formats for ecological samples. This means that every specimen (identity) has to be present as a separate object.