Description Usage Arguments Details Output Author(s) Examples
View source: R/plot_functions.R
Plot timeseries values as boxplots.
1 2 3 |
data |
A valid data frame containing scalar or timeseries values
from a ss3sim simulation. That data are generated from
|
y |
A character string denoting which column to use as the y variable. Must be a numeric column. |
horiz, horiz2 |
A character string denoting which column to use as
the first ( |
vert, vert2 |
A character string denoting which column to use as
the first ( |
relative.error |
Boolean for whether the y-axis should be
interpreted as relative error. If |
axes.free |
Boolean for whether the y-axis scales should be free
in |
print |
A logical for whether the plot is printed or not. |
The ss3sim plotting functions are simply
wrappers for ggplot2 code, specific to the output from
ss3sim simulation scalar and timeseries (ts) objects. They are
designed to quickly explore simulation output, rather than
publication-level figures. The functions use the aes_string
function within ggplot2 such that arguments are passed as
characters that refer to columns of data
.
Note that there are some subtle differences between the
functions. Scalar plots require a value for x
, while for ts plots
x
is invalid because it is fixed internally as 'year', since it
makes no sense to use another column. Boxplots cannot have a color
mapped to them like points or lines, and thus color
is not a
valid argument. The ts point and line plots are grouped internally by
'ID', which is a combination of scenario and iteration.
These functions print the ggplot
object, but
also return it invisibly for saving or printing again later.
Cole Monnahan
1 2 3 4 5 6 7 8 | ## Not run:
ts_dat$SpawnBio <- with(ts_dat, (SpawnBio_om-SpawnBio_em)/SpawnBio_om)
# Merge in max_grad, a performance metric, to use for color
ts_dat <- merge(scalar_dat[, c("ID", "max_grad")], ts_dat)
plot_ts_boxplot(ts_dat, y = "SpawnBio", horiz = "D", vert = "E",
relative.error = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.