dot_plot | R Documentation |
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.
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" )
data |
A df from |
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 |
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.
Dot plots of mean parameter values with standard deviation
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.