Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions R/plot_abundance_at_age.R
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
#' Plot Abundance (or Numbers) at Age (AAA or NAA)
#' Plot Abundance at Age
#'
#' @param dat A data frame returned from \link[stockplotr]{convert_output}
#' @param facet 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.
#'
#' Default: NULL (function will automatically detect and indexing in the data
#' and place them into group then facet)
#' @param unit_label units for abundance
#'
#' Default: "fish"
#' @param scale_amount 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.
#' @param proportional 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
#' in the legend label if proportional is set to FALSE.
#'
#' Default: 1,000.
#' @param proportional Set size of points relative to abundance. When TRUE, point
#' size are relative to one another. When set to FALSE, point size
#' is relative to abundance.
#'
#' Default: TRUE
#' @param make_rda 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 .rda will be exported to the folder indicated in the argument "figures_dir".
#'
#' Default: FALSE
#' @param figures_dir 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.
#' @returns A plot showing total abundance (or numbers) at age.
#'
#' Default: getwd()
#' @returns Plot of total abundance at age.
#'
#' @details The input is from an assessment model output file
#' translated to a standardized output (\link[stockplotr]{convert_output}).
Expand All @@ -38,9 +50,7 @@
#' facet = "growth_pattern",
#' unit_label = "fish",
#' scale_amount = 1000,
#' proportional = TRUE,
#' make_rda = FALSE,
#' figures_dir = getwd()
#' proportional = TRUE
#' )
#' plot_abundance_at_age(
#' dat = stockplotr:::example_data,
Expand Down
40 changes: 25 additions & 15 deletions man/plot_abundance_at_age.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 18 additions & 8 deletions man/plot_biomass_at_age.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions man/plot_catch_comp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading