dot_plot: Dot plots of mean Vortex parameters

dot_plotR Documentation

Dot plots of mean Vortex parameters

Description

dot_plot generates dot plots of mean parameter values for each population (row) at each year value requested with 'yrs' (columns). Bars represent standard deviation.

Usage

dot_plot(
  data,
  project,
  scenario,
  yrs = c(1, 2),
  params = c("PExtinct", "Nextant", "Het", "Nalleles"),
  setcolour = "scen.name",
  plotpops = c("all"),
  save2disk = TRUE,
  dir_out = "Plots"
)

Arguments

data

A df from collate_dat

project

Vortex project name (used to name the output)

scenario

Vortex scenario name (used to name the output)

yrs

The years to be included in the plot

params

Vortex parameters to be plotted, default: c('PExtinct', 'Nextant', 'Het', 'Nalleles')

setcolour

Variable to be used to set colours of data, default: scen.name

plotpops

The populations to be included in the plot, default: 'all'

save2disk

Whether to save the output to disk, default: TRUE

dir_out

The local path to store the output. Default: Plots

Details

Plots are ggplot objects. When save2disk=TRUE these are saved as .rda and .pdf files

yrs can be a numeric vector of length >= 1 (e.g. yrs=c(50,100)). Each point in time will be plotted in different columns.

If a continuous variable is passed to setcolour, a continuous gradient of colour will be assigned to the marker (e.g. for example, a scale from blue to black). If a sharp change of colours between different values of a continuous variable is desired, it has to be converted into a factor.

Value

Dot plots of mean parameter values with standard deviation

Examples

# Using Pacioni et al. example data. See ?pac.clas for more details.
data(pac.clas)
dot <- dot_plot(data=pac.clas, project='Pacioni_et_al', scenario='ST_Classic',
               yrs=c(80, 120),
               params=c('PExtinct', 'Nextant', 'Het', 'Nalleles'),
               save2disk=FALSE)

carlopacioni/vortexR documentation built on May 6, 2022, 12:07 p.m.