Plot Total Biomass
plot_biomass(
dat,
geom = "line",
group = NULL,
facet = NULL,
ref_line = "msy",
era = NULL,
unit_label = "mt",
module = NULL,
scale_amount = 1,
relative = FALSE,
make_rda = FALSE,
figures_dir = getwd(),
interactive = TRUE,
...
)A tibble or named list of tibbles (input as `list()`) returned from convert_output.
If inputting a list of tibbles, the first tibble's reference point defined in `ref_line` is used to plot a reference line or calculate relative spawning biomass.
A string stating the geom used for the plot.
Default: "line".
Options: "line", "point", or "area"
A string of a single column that groups the data.
Set group = "none" to summarize data over all indexing values.
Default: NULL Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL
A string or vector of strings of a column name.
Default: NULL
A string specifying the type of reference you want to compare biomass to. The default `"msy"` looks for `"biomass_msy"` in the `"label"` column of `dat`. The actual searching in `dat` is case-agnostic and will work with either upper- or lower-case letters. However, you must use one of the options specified in the default list to ensure that the label on the figure looks correct regardless of how it is specified in `dat`.
Default: "msy"
Options: Including, but not limited to: "target", "MSY", "unfished"
A string naming the era of data.
Default: "time"
Options: "early", "time", "fore" (forecast), or NULL (all data)
units for biomass
Default: "mt"
(Optional) A string indicating the module_name found in `dat`. If selecting >1 module, place them in a vector like c("module1", "module2").
Default: NULL
If the interactive and >1 module_name is found, user will select the module_name in the console. @seealso [filter_data()]
A number to scale the y-axis values.
Default: 1
A logical value specifying to set y-axis values relative to the ref_line value.
Default: `FALSE`
A logical value indicating whether to save the object and make an automated caption and alternative text in the form of an `rda` object. If TRUE, the rda will be exported to the folder indicated in the argument "figures_dir".
Default: `FALSE`.
A string indicating a path to the "figures" folder.
Default: `getwd()`
The folder is created within the path if it does not exist.
A logical value indicating if the environment is interactive.
Default: `FALSE`
Arguments called from geom_line or geom_point
A plot showing total biomass.
The input is from an assessment model output file translated to a standardized output (convert_output). There are options to return a `ggplot2` object or export an .rda object containing associated caption and alternative text for the figure.
[convert_output()], [plot_timeseries()], [calculate_reference_point()], [reference_line()], [filter_data()], [process_data()], [export_kqs()], [insert_kqs()], [create_rda()]
plot_biomass(
dat = stockplotr:::example_data,
unit_label = "mt",
ref_line = c("target" = 20000),
scale_amount = 100,
module = "TIME_SERIES",
figures_dir = getwd()
)
#> Ignoring unknown labels:
#> • linetype : "Fleet"
#> • shape : "Fleet"
#> Ignoring unknown labels:
#> • linetype : "Fleet"
#> • shape : "Fleet"
plot_biomass(
dat = stockplotr:::example_data,
ref_line = NULL,
module = "TIME_SERIES",
figures_dir = getwd()
)
#> Ignoring unknown labels:
#> • linetype : "Fleet"
#> • shape : "Fleet"