R/plot_abundance_at_age.R
plot_abundance_at_age.RdPlot Abundance (or Numbers) at Age (AAA or NAA)
plot_abundance_at_age(
dat,
facet = NULL,
unit_label = "fish",
scale_amount = 1000,
proportional = TRUE,
make_rda = FALSE,
figures_dir = getwd()
)A data frame returned from convert_output
a string or vector of strings of column(s) that groups the data (e.g. "fleet", "sex", "area", etc.). Set facet = "none" to summarize the data in a single plot.
units for abundance
A number describing how much to scale down the abundance at age. Please choose a value ranging from 1-1,000,000,000 (one billion) in orders of magnitude (e.g., 1, 10, 100, 1000, etc.). For example, scale_amount = 100 would scale down a value from 500,000 –> 5,000 and would report abundance in hundreds of fish (if "fish" was the unit_label). This scale will be reflected in the legend label if proportional is set to FALSE. The default is 1,000.
Set size of points relative to z when TRUE, point size are relative to one another while when set to FALSE, point size is relative to z
TRUE/FALSE; indicate whether to produce an .rda file containing a list with the figure/table, caption, and alternative text (if figure). If TRUE, the .rda will be exported to the folder indicated in the argument "rda_dir". Default is FALSE.
The location of the folder containing the generated .rda files ("rda_files") that will be created if the argument `make_rda` = TRUE. Default is the working directory.
Plot total abundance (or numbers) at age from a stock assessment model using a standardized output made from convert_output). Units of abundance can either be manually added or will be extracted from the provided file if possible.
plot_abundance_at_age(
dat = stockplotr:::example_data,
facet = "growth_pattern",
unit_label = "fish",
scale_amount = 1000,
proportional = TRUE,
make_rda = FALSE,
figures_dir = getwd()
)
#> ! Multiple module names found in data.
#> ℹ Environment not interactive. Selecting NUMBERS_AT_AGE.
#> Joining with `by = join_by(year, sex, growth_pattern)`
plot_abundance_at_age(
dat = stockplotr:::example_data,
facet = "none",
proportional = FALSE
)
#> ! Multiple module names found in data.
#> ℹ Environment not interactive. Selecting NUMBERS_AT_AGE.
#> Joining with `by = join_by(year)`