diff --git a/DESCRIPTION b/DESCRIPTION index 57273285..02a7d01e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -70,4 +70,4 @@ Config/testthat/parallel: false Encoding: UTF-8 Language: en-US LazyData: true -RoxygenNote: 7.3.3 +Config/roxygen2/version: 8.0.0 diff --git a/R/add_theme.R b/R/add_theme.R index 4937e5a7..80446bb0 100644 --- a/R/add_theme.R +++ b/R/add_theme.R @@ -3,6 +3,8 @@ #' @param x table or figures object from ggplot, base r plot, gt table, flextable, or kable extra #' @param discrete TRUE/FALSE indicate if data input is discrete. Specifically applied to plots. #' +#' Default: TRUE +#' #' @returns Add the standard formatting for stock assessment reports for any #' figure or table. #' @details Currently, the function is able to format objects from: diff --git a/R/convert_output.R b/R/convert_output.R index 92aff989..e4efb507 100644 --- a/R/convert_output.R +++ b/R/convert_output.R @@ -3,12 +3,19 @@ #' Format stock assessment output files to a standardized format. #' #' @param file Assessment model output file path -#' @param model Assessment model used in evaluation ("ss3", "bam", -#' "fims", "rceattle). +#' @param model Assessment model used in evaluation +#' +#' Default: NULL +#' +#' Options: "ss3", "bam", "fims", "rceattle" #' @param fleet_names Names of fleets in the assessment model as #' shortened in the output file. If fleet names are not properly read, then #' indicate the fleets names as an acronym in a vector +#' +#' Default: NULL #' @param save_dir File path to save the converted output file. +#' +#' Default: NULL #' #' @author Samantha Schiano #' diff --git a/R/html_all_figs_tables.R b/R/html_all_figs_tables.R index 9c0fddae..dbd66981 100644 --- a/R/html_all_figs_tables.R +++ b/R/html_all_figs_tables.R @@ -5,6 +5,8 @@ #' @param figures_tables_dir The location of the folder containing #' figures and tables ("figures" and "tables"). #' +#' Default: The current working directory (`getwd()`) +#' #' @returns A folder ("all_tables_figures") in your working directory containing #' html and qmd files that show all tables and figures. #' diff --git a/R/plot_abundance_at_age.R b/R/plot_abundance_at_age.R index 91714d58..2c38be90 100644 --- a/R/plot_abundance_at_age.R +++ b/R/plot_abundance_at_age.R @@ -1,26 +1,44 @@ #' Plot Abundance (or Numbers) at Age (AAA or NAA) #' #' @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. +#' @param facet a string or vector of strings of a column that facets the data. +#' Set facet = "none" to summarize the data in a single plot. +#' +#' Default: NULL +#' +#' Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", +#' NULL +#' #' @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. +#' in the legend label if proportional is set to FALSE. +#' +#' Default: 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 +#' +#' 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. +#' +#' 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. +#' +#' Default: the working directory (`getwd()`) +#' #' @returns A plot showing total abundance (or numbers) at age. #' #' @details The input is from an assessment model output file diff --git a/R/plot_biomass.R b/R/plot_biomass.R index 8c41ba6e..c3ba3bb4 100644 --- a/R/plot_biomass.R +++ b/R/plot_biomass.R @@ -2,14 +2,19 @@ #' #' @inheritParams plot_spawning_biomass #' @param unit_label units for biomass +#' +#' Default: "mt" #' @param ref_line A string specifying the type of reference you want to -#' compare biomass to. The default is `"msy"`, which looks for +#' 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 but you must use one of the options specified in the +#' 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`. Other possibilities may include -#' "target", "MSY", and "unfished". +#' regardless of how it is specified in `dat`. +#' +#' Default: "msy" +#' +#' Options: Including, but not limited to: "target", "MSY", "unfished" #' @returns A plot showing total biomass. #' #' @details The input is from an assessment model output file @@ -43,7 +48,7 @@ plot_biomass <- function( facet = NULL, ref_line = "msy", era = NULL, - unit_label = "metric tons", + unit_label = "mt", module = NULL, scale_amount = 1, relative = FALSE, diff --git a/R/plot_biomass_at_age.R b/R/plot_biomass_at_age.R index 1bc5e131..c0933bf5 100644 --- a/R/plot_biomass_at_age.R +++ b/R/plot_biomass_at_age.R @@ -5,9 +5,14 @@ #' age. For example, scale_amount = 100 would scale down a value #' from 500,000 --> 5,000. This scale will be reflected in the legend label if #' proportion is set to FALSE. +#' +#' Default: 1,000 +#' #' @param interactive TRUE/FALSE; indicate whether the environment in which the #' function is operating is interactive. This bypasses some options for -#' filtering when preparing data for the plot. Default is FALSE. +#' filtering when preparing data for the plot. +#' +#' Default: `TRUE` #' #' @returns A plot showing total biomass at age. #' @@ -40,7 +45,7 @@ plot_biomass_at_age <- function( unit_label = "mt", scale_amount = 1000, proportional = TRUE, - interactive = FALSE, + interactive = TRUE, make_rda = FALSE, figures_dir = getwd() ) { diff --git a/R/plot_catch_comp.R b/R/plot_catch_comp.R index 560aec60..0a900e48 100644 --- a/R/plot_catch_comp.R +++ b/R/plot_catch_comp.R @@ -2,22 +2,36 @@ #' #' @inheritParams plot_abundance_at_age #' @param unit_label indicate the name of the units of catch as to label the axis +#' +#' Default: "mt" +#' #' @param scale_amount A number describing how much to scale down the catch 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 catch in #' hundreds of the 'unit_label'. This scale will be reflected -#' in the legend label if proportional is set to FALSE. The default is 1. -#' @param era a string naming the era of data such as historical ("early"), current ("time"), or -#' projected ("fore") data if filtering should occur. Default is set to "time" which is -#' the current time. To plot all data, set era to NULL. -#' @param interactive TRUE/FALSE; indicate whether the environment in which the -#' function is operating is interactive. This bypasses some options for -#' filtering when preparing data for the plot. Default is FALSE. -#' @param module (Optional) A string indicating the linked module_name associated -#' with the label for the plot if known. Default is NULL. By default, the function -#' will select the most relevant module if more than 1 exists. +#' in the legend label if proportional is set to FALSE. +#' +#' Default: 1 +#' +#' @param era A string naming the era of data. +#' +#' Default: "time" #' +#' Options: "early", "time", "fore" (forecast), or NULL (all data) +#' +#' @param interactive A logical value indicating if the environment is interactive. +#' +#' Default: `FALSE` +#' +#' @param module (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()] +#' #' @returns A plot showing catch or landings composition. #' #' @details This plot is made only when catch or landings are explicitly named diff --git a/R/plot_indices.R b/R/plot_indices.R index a7ef9f6a..e9932ae9 100644 --- a/R/plot_indices.R +++ b/R/plot_indices.R @@ -1,12 +1,18 @@ #' Plot Index of Abundance #' #' @inheritParams plot_spawning_biomass -#' @param facet a string or vector of strings of a column that facets the data -#' (e.g. "year", "area", etc.) "fleet" is always added on to any faceting selections +#' @param facet a string or vector of strings of a column that facets the data. "fleet" is always added on to any faceting selections +#' +#' Default: NULL +#' +#' Options: May include, but is not limited to: "fleet", "year", "area", NULL #' @param unit_label units for index of abundance/CPUE +#' +#' Default: "" #' @param focus a string or vector of strings indicating how data should be #' filtered. (i.e. select names of fleets to zoom into the plot) #' +#' Default: NULL #' @returns A plot showing the expected and predicted indices. #' #' @details The input is from an assessment model output file diff --git a/R/plot_landings.R b/R/plot_landings.R index d1967521..b2d20da4 100644 --- a/R/plot_landings.R +++ b/R/plot_landings.R @@ -30,7 +30,7 @@ #' ) plot_landings <- function( dat, - unit_label = "metric tons", + unit_label = "mt", geom = "line", group = NULL, facet = NULL, diff --git a/R/plot_recruitment.R b/R/plot_recruitment.R index 69abdd08..712f275f 100644 --- a/R/plot_recruitment.R +++ b/R/plot_recruitment.R @@ -3,6 +3,8 @@ #' @inheritParams plot_spawning_biomass #' @param unit_label units for recruitment #' +#' Default: "mt" +#' #' @returns A plot showing recruitment over time. #' #' @details The input is from an assessment model output file diff --git a/R/plot_spawning_biomass.R b/R/plot_spawning_biomass.R index 9938c80c..e07f1cbf 100644 --- a/R/plot_spawning_biomass.R +++ b/R/plot_spawning_biomass.R @@ -13,12 +13,13 @@ #' Default: "line". #' #' Options: "line", "point", or "area" -#' @param group A string of a single column that groups the data (e.g. "fleet", -#' "sex", "area", etc.). +#' @param group 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 +#' #' @param facet A string or vector of strings of a column name. #' #' Default: NULL @@ -35,13 +36,14 @@ #' If the reference point is not found in the data, set ref_line = c("name" = value). #' @param unit_label A string specifying spawning biomass unit. #' -#' Default: "metric tons" +#' Default: "mt" #' @param lbs A logical value indicating whether to convert the y-axis values from #' kilograms to pounds. The default units match the default in the -#' unit_label argument - 'metric tons'. +#' unit_label argument - 'mt'. #' #' Default: `FALSE` #' @param module (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 #' @@ -107,7 +109,7 @@ plot_spawning_biomass <- function( group = NULL, facet = NULL, ref_line = "msy", - unit_label = "metric tons", + unit_label = "mt", era = NULL, lbs = FALSE, module = NULL, diff --git a/R/plot_stock_recruitment.R b/R/plot_stock_recruitment.R index 810397e8..23e6cc33 100644 --- a/R/plot_stock_recruitment.R +++ b/R/plot_stock_recruitment.R @@ -5,9 +5,17 @@ #' plot is being made in is interactive. By default, this #' is set to false. If true, dependent on your data, a #' option menu will pop-up. +#' +#' Default: TRUE +#' #' @param spawning_biomass_label Units for spawning biomass +#' +#' Default: "mt" +#' #' @param recruitment_label units for recruitment #' +#' Default: "mt" +#' #' @returns A plot showing the stock recruitment relationship. #' #' @details The input is from an assessment model output file diff --git a/R/process_data.R b/R/process_data.R index 78660a55..b4499283 100644 --- a/R/process_data.R +++ b/R/process_data.R @@ -6,17 +6,29 @@ #' #' @param dat Pre-filtered data from \link[stockplotr]{filter_data} following a #' long format data. -#' @param group A string identifying the indexing variable of the data. If you -#' want to just summarize the data across all factors, set group = "none". +#' @param group A string identifying the indexing variable of the data. +#' To remove any groups and summarize data across all factors, set +#' group = "none". Setting group = NULL will keep any grouping +#' variables identified in the data by the function. +#' +#' Default: NULL +#' +#' Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL #' @param facet A string or vector of strings identifying the faceting #' variable(s) of the data. +#' +#' Default: NULL #' @param lbs A logical value indicating whether to convert the y-axis values from #' kilograms to pounds. The default units match the default in the #' unit_label argument - 'metric tons'. #' #' Default: `FALSE` #' @param method A string describing the method of summarizing data when group -#' is set to "none". Options are "sum" or "mean". Default is "sum". +#' is set to "none". +#' +#' Default: "sum" +#' +#' Options: "sum" or "mean" #' #' @returns List of 3 objects: #' \item{data}{A data frame of the processed data ready for plotting.} @@ -360,6 +372,8 @@ process_data <- function( #' #' @inheritParams process_data #' @param label A string or vector of strings identifying the label values to filter the data. +#' +#' Default: NULL #' #' @returns A dataframe of processed data ready for formatting into a table. #' @details Input is an object created with \link[stockplotr]{filter_data}. @@ -369,7 +383,7 @@ process_data <- function( #' @examples { #' filtered <- filter_data( #' dat = stockplotr:::example_data, -#' label_name = "landings", +#' label = "landings", #' geom = "line", #' era = "time" #' ) diff --git a/R/save_all_plots.R b/R/save_all_plots.R index b2119135..10249c6e 100644 --- a/R/save_all_plots.R +++ b/R/save_all_plots.R @@ -7,9 +7,18 @@ #' the recruitment quantities shown on the y axis. For example, #' recruitment_scale_amount = 100 would scale down a value from 500,000 --> #' 5,000. This scale will be reflected in the y axis label. +#' +#' Default: 1 +#' #' @param recruitment_unit_label Units for recruitment +#' +#' Default: "mt" +#' #' @param figures_tables_dir The location of the folder containing #' figures and tables ("figures" and "tables"). +#' +#' Default: the working directory (`getwd()`) +#' #' @param ref_line A string specifying the type of reference you want to #' compare biomass to. The default is `"msy"`, which looks for #' `"biomass_msy"` in the `"label"` column of `dat`. The actual @@ -19,28 +28,82 @@ #' regardless of how it is specified in `dat`. Other possibilities may include #' "target", "MSY", and "unfished". When the reference cannot be found, #' indicate the reference line in the form c("label" = value). +#' +#' Default: "msy" +#' +#' Options: Including, but not limited to: "target", "MSY", "unfished" +#' #' @param biomass_scale_amount A number describing how much to scale down the #' biomass quantities shown on the y axis. See `recruitment_scale_amount`. +#' +#' Default: 1 +#' #' @param landings_unit_label Units for landings +#' +#' Default: "mt" +#' #' @param biomass_unit_label Units for biomass +#' +#' Default: "mt" +#' #' @param spawning_biomass_label Units for spawning biomass +#' +#' Default: "mt" +#' #' @param spawning_biomass_scale_amount A number describing how much to scale down the #' spawning biomass quantities shown on the y axis. See `recruitment_scale_amount`. +#' +#' Default: 1 +#' #' @param ref_line_sb Identical definition as `ref_line`, but this argument is #' applied to plot_spawning_biomass. +#' +#' Default: "msy" +#' +#' Options: Including, but not limited to: "target", "MSY", "unfished" +#' #' @param abundance_at_age_scale_amount A number describing how much to scale down the #' abundance quantities shown via bubble size. See `recruitment_scale_amount`. +#' +#' Default: 1 +#' #' @param abundance_at_age_unit_label Abbreviated units for abundance at age +#' +#' Default: "fish" +#' #' @param biomass_at_age_scale_amount A number describing how much to scale down the #' biomass quantities shown via bubble size. See `recruitment_scale_amount`. +#' +#' Default: 1 +#' #' @param biomass_at_age_unit_label Abbreviated units for biomass at age +#' +#' Default: "mt" +#' #' @param indices_unit_label Units for index of abundance/CPUE +#' +#' Default: "" +#' #' @param biomass_unit_label Abbreviated units for biomass +#' +#' Default: "mt" +#' #' @param catch_unit_label Abbreviated units for catch +#' +#' Default: "mt" +#' #' @param catch_scale_amount A number describing how much to scale down the #' catch quantities shown via bubble size. See `recruitment_scale_amount`. +#' +#' Default: 1 +#' #' @param landings_unit_label Units for landings +#' +#' Default: "mt" +#' #' @param proportional T/F to scale size of bubble plots +#' +#' Default: `TRUE` #' #' @returns Rda files for each figure/table. #' diff --git a/R/table_bnc.R b/R/table_bnc.R index a6775e44..3f0ee7db 100644 --- a/R/table_bnc.R +++ b/R/table_bnc.R @@ -40,7 +40,8 @@ # biomass_label <- glue::glue("Biomass ({biomass_unit_label})") # catch_label <- glue::glue("Catch ({catch_unit_label})") # sb_label <- glue::glue("Spawning biomass ({sb_unit_label})") - +# TODO: Update documentation to match formatting of other functions, with +# lines for Default and Options # # create plot-specific variables to use throughout fxn for naming and IDing # topic_label <- "bnc" diff --git a/R/table_indices.R b/R/table_indices.R index 63206eb4..90b20992 100644 --- a/R/table_indices.R +++ b/R/table_indices.R @@ -3,7 +3,7 @@ # #' @inheritParams plot_recruitment # #' @param tables_dir The location of the folder containing the generated table # #' rda files ("tables") that will be created if the argument `make_rda` = TRUE. -# #' Default is the working directory. +# #' Default: the working directory (`getwd()`) # #' @returns A table of observed annual indices of abundance plus error # #' stratified by fleet. # #' @details The input is from an assessment model output file diff --git a/R/table_landings.R b/R/table_landings.R index 52d14eac..95570d3c 100644 --- a/R/table_landings.R +++ b/R/table_landings.R @@ -2,16 +2,30 @@ #' #' @inheritParams plot_recruitment #' @param unit_label Abbreviated units of landings -#' @param group A string identifying the indexing variable of the data. If you -#' want to just summarize the data across all factors, set group = "none". +#' +#' Default: "mt" +#' @param group 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 #' @param method A string describing the method of summarizing data when group -#' is set to "none". Options are "sum" or "mean". Default is "sum". +#' is set to "none". +#' +#' Default: "sum" +#' +#' Options: "sum" or "mean" #' @param tables_dir The location of the folder containing the generated table #' rda files ("tables") that will be created if the argument `make_rda` = TRUE. +#' +#' Default: the working directory (`getwd()`) #' @param label The label that will be chosen from the input file. If unspecified, #' the function will search the "label" column and use the first matching label #' in this ordered list: "landings_weight", "landings_numbers", "landings_expected", #' "landings_predicted", "landings". +#' +#' Default: NULL #' #' @returns A table ready of landed catch by fleet and year. #' diff --git a/R/theme_noaa.R b/R/theme_noaa.R index 58ebc5fe..6885af4c 100644 --- a/R/theme_noaa.R +++ b/R/theme_noaa.R @@ -1,6 +1,9 @@ #' Add NOAA theming to ggplot2 object. The palette is from the 'viridis' package, which contains palettes distinguishable by those with color vision deficiency. #' -#' @param discrete Variable indicating whether the color or fill aesthetic is discrete. Default is TRUE. +#' @param discrete Variable indicating whether the color or fill aesthetic is discrete. +#' +#' Default: TRUE +#' #' @param ... Arguments passed to `ggplot2::theme()`. #' #' @returns A list applying a theme to a ggplot2 object. diff --git a/R/utils_plot.R b/R/utils_plot.R index 16918a83..e3a3c5f8 100644 --- a/R/utils_plot.R +++ b/R/utils_plot.R @@ -6,19 +6,36 @@ #' #' @param dat filtered data frame from standard output file(s) preformatted for #' the target label from \link[stockplotr]{filter_data} -#' @param x a string of the column name of data used to plot on the x-axis (default -#' is "year") -#' @param y a string of the column name of data used to plot on the y-axis (default -#' is "estimate") +#' @param x a string of the column name of data used to plot on the x-axis +#' +#' Default: "year" +#' @param y a string of the column name of data used to plot on the y-axis +#' +#' Default: "estimate" +#' #' @param geom type of geom to use for plotting found in ggplot2 (e.g. "point", -#' "line", etc.). Default is "line". Other options are "point" and "area". -#' @param xlab a string of the x-axis label (default is "Year") +#' "line", etc.). +#' +#' Default: "line" +#' +#' Options: "point" and "area" +#' @param xlab a string of the x-axis label +#' +#' Default: "Year" #' @param ylab a string of the y-axis label. If NULL, it will be set to the name #' of `y`. -#' @param group a string of a single column that groups the data (e.g. "fleet", -#' "sex", "area", etc.). Currently can only have one level of grouping. +#' +#' Default: NULL +#' @param group a string of a single column that groups the data. +#' Currently can only have one level of grouping. +#' +#' Default: NULL +#' Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL +#' #' @param facet a string or vector of strings of a column that facets the data #' (e.g. "year", "area", etc.) +#' +#' Default: NULL #' @param ... inherited arguments from internal functions from ggplot2::geom_xx #' #' @@ -218,22 +235,10 @@ plot_timeseries <- function( #' Create plot with error #' -#' @param dat filtered data frame from standard output file(s) preformatted for -#' the target label from \link[stockplotr]{process_data} -#' @param x a string of the column name of data used to plot on the x-axis (default -#' is "year") -#' @param y a string of the column name of data used to plot on the y-axis (default -#' is "estimate") -#' @param geom type of geom to use for plotting found in ggplot2 (e.g. "point", -#' "line", etc.). Default is "line". Other options are "point" and "area". -#' @param xlab a string of the x-axis label (default is "Year") -#' @param ylab a string of the y-axis label. If NULL, it will be set to the name -#' of `y`. -#' @param group a string of a single column that groups the data (e.g. "fleet", -#' "sex", "area", etc.). Currently can only have one level of grouping. -#' @param facet a string or vector of strings of a column that facets the data -#' (e.g. "year", "area", etc.) +#' @inheritParams plot_timeseries #' @param hline indicate true or false to place a horizontal line at 1 +#' +#' Default: `TRUE` #' @param ... inherited arguments from internal functions from ggplot2::geom_xx #' #' @returns Create a plot with error for a stock assessment report. @@ -301,24 +306,36 @@ plot_error <- function( #' Create "at-age" plot #' -#' @param dat filtered data frame from standard output file(s) preformatted for -#' the target label from \link[stockplotr]{filter_data} -#' @param x a string of the column name of data used to plot on the x-axis -#' (default is "year") +#' @inheritParams plot_timeseries #' @param y a string of the column name of data used to plot on the y-axis -#' (default is "age") +#' +#' Default: "age" #' @param z a string of the column name of data used to control the size of the -#' bubbles (default is "estimate") +#' bubbles +#' +#' Default: "estimate" #' @param label a string of the label for the size of the bubbles -#' (default is "Abundance") -#' @param xlab a string of the x-axis label (default is "Year") -#' @param ylab a string of the y-axis label (default is "Age") -#' @param facet a string or vector of strings of a column that facets the data -#' (e.g. "sex", "area", etc.). It is not recommended to include more than one -#' facet due to the complexity of the plot. +#' +#' Default: "Abundance" +#' +#' @param xlab a string of the x-axis label +#' +#' Default: "Year" +#' @param ylab a string of the y-axis label +#' +#' Default: "Age" +#' @param facet a string or vector of strings of a column that facets the data. +#' It is not recommended to include more than one facet due to the complexity +#' of the plot. +#' +#' Default: NULL +#' +#' Options: Including, but not limited to: "sex", "area", "fleet" #' @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 +#' +#' Default: `TRUE` #' @param ... inherited arguments from internal functions from #' \link[ggplot2]{geom_point} #' @@ -512,8 +529,9 @@ cohort_line <- function( #' @param dat standard data frame where reference point should be extracted #' @param label_name string of the name of the quantity that users want to #' extract the reference point from -#' @param reference string. name of the reference point such as "msy", -#' "unfished", or "target" +#' @param reference string of the reference point +#' +#' Options: Including, but not limited to: "msy", "unfished", "target" #' #' @returns A ggplot2 geom_hline object for a reference point that can be added #' to a plot @@ -617,26 +635,9 @@ cap_first_letter <- function(s) { #' Filter data for input into aesthetics for ggplot2 #' -#' @param dat a data frame or list of data frames input as `list()` that -#' contains the data to be plotted. +#' @inheritParams plot_spawning_biomass #' @param label_name a string of the name of the label that is used to filter #' the data. -#' @param geom Type of plot user wants to create. Options are "line", "point", -#' and "area". -#' @param group Name of a column selected grouping for the data. -#' @param facet a string or vector of strings of a column that facets the data -#' (e.g. "year", "area", etc.) -#' @param era A string naming the era of data such as historical ("early"), current ("time"), or -#' projected ("fore") data if filtering should occur. Default is set to "time" which is -#' the current time. To plot all data, set era to NULL. -#' @param scale_amount A number describing how much to scale down the quantities -#' shown on the y axis. -#' @param interactive logical. If TRUE, the user will be prompted to select -#' a module_name when there was more than one found in the filtered data set. -#' @param module (Optional) A string indicating the linked module_name associated -#' with the label for the plot if known. Default is NULL. By default, the function -#' will select the most relevant module if more than 1 exists. If selecting more -#' than one module, place them in a vector such as c("module1", "module2"). #' #' @returns a data frame that is preformatted for plotting with ggplot2. #' @export @@ -1017,8 +1018,11 @@ check_grouping <- function(dat) { #' Plot observed vs. predicted data #' #' @inheritParams plot_timeseries -#' @param observed_label a string of the label used to filter the observed data. Default is "observed". -#' @param predicted_label a string of the label used to filter the predicted data. Default is "predicted". +#' @param observed_label a string of the label used to filter the observed data +#' +#' Default: "observed" +#' @param predicted_label a string of the label used to filter the predicted data +#' Default: "predicted" #' #' @returns A plot of observed vs. predicted data for a stock assessment report. #' @export diff --git a/R/utils_rda.R b/R/utils_rda.R index abe31d1f..5072debb 100644 --- a/R/utils_rda.R +++ b/R/utils_rda.R @@ -197,13 +197,29 @@ insert_kqs <- function(...) { #' @param dat Data frame containing data which will fill in captions and #' alternative text for the object #' @param dir Directory to where the rda will be saved -#' @param year Default to current year -#' @param ref_line Reference line value such as "msy", "target" or "unfished" -#' @param ref_point Reference point value such as "msy", "target" or "unfished" +#' +#' Default: the working directory (`getwd()`) +#' +#' @param year Assessment year +#' +#' Default: the current year +#' +#' @param ref_line Reference line value +#' +#' Default: "msy" +#' +#' Options: Including, but not limited to: "msy", "target", "unfished" +#' #' @param scale_amount A number describing how much to scale down the quantities #' shown on the y axis. For example, scale_amount = 100 would scale down a value #' from 500,000 --> 5,000. This scale will be reflected in the y axis label. +#' +#' Default: 1 +#' #' @param unit_label A string containing a unit label for the y-axis +#' +#' Default: "mt" +#' #' @param table_df The data frame that the table will be made into for purposes #' of exporting a latex formatted table. #' @@ -229,7 +245,6 @@ create_rda <- function( dir = getwd(), year = format(as.POSIXct(Sys.Date(), format = "%YYYY-%mm-%dd"), "%Y"), ref_line = "msy", - ref_point = "msy", # this is not used anywhere scale_amount = 1, unit_label = "mt", table_df = NULL @@ -500,9 +515,17 @@ create_rda <- function( #' @param topic_label A string that describes a figure or table's label. These #' labels are found in the "label" column of the "captions_alt_text.csv" file #' and are used to link the figure or table with its caption/alt text. +#' +#' Default: NULL +#' #' @param fig_or_table A string describing whether the plot is a figure or table. +#' +#' Default: NULL +#' #' @param dir The directory containing the "captions_alt_text.csv" file. #' +#' Default: the working directory (`getwd()`) +#' #' @returns A figure's caption and alternative text, in a list, or a table's caption. #' @seealso [export_rda()], [create_rda()] #' @export @@ -566,19 +589,38 @@ extract_caps_alttext <- function(topic_label = NULL, #' Typically used after stockplotr::extract_caps_alttext(). #' #' @param object The final figure (ggplot) or table (flextable) object. +#' +#' Default: NULL +#' #' @param caps_alttext The object containing a figure's caption and alternative #' text, in a list, or a table's caption, likely generated with #' stockplotr::extract_caps_alttext(). +#' +#' Default: NULL +#' #' @param figures_tables_dir If the user has already created folders containing #' figures and tables ("figures" and "tables"), figures_tables_dir represents #' the location of these folders. Otherwise, these two folders will be created #' automatically, then used to store the exported rda files. +#' +#' Default: NULL +#' #' @param topic_label A string that describes a figure or table's label. These #' labels are found in the "label" column of the "captions_alt_text.csv" file #' and are used to link the figure or table with its caption/alt text. +#' +#' Default: NULL +#' #' @param fig_or_table A string describing whether the plot is a figure or table. +#' +#' Default: NULL +#' +#' Options: "figure", "table" +#' #' @param latex_table The object containing a LaTeX-based table. -#' +#' +#' Default: NULL +#' #' @returns An rda file with a figure's ggplot, caption, and alternative text, or #' a table's gt-based table, caption, and LaTeX-based table. #' @seealso [create_rda()], [extract_caps_alttext()] diff --git a/R/utils_table.R b/R/utils_table.R index c7fe4ffe..5ffbc3b4 100644 --- a/R/utils_table.R +++ b/R/utils_table.R @@ -106,6 +106,8 @@ create_latex_table <- function(data, #' @param dat input data into process_table #' @param index_variables the index_variables vector created within process_table #' @param id_group the identifying index variable as a string +#' +#' Default: NULL check_label_differences <- function(dat, index_variables, id_group = NULL) { # Loop over model to perform checks if the model columns are identical diff --git a/man/add_theme.Rd b/man/add_theme.Rd index aabbc9e6..a8de46b0 100644 --- a/man/add_theme.Rd +++ b/man/add_theme.Rd @@ -9,7 +9,9 @@ add_theme(x, discrete = TRUE) \arguments{ \item{x}{table or figures object from ggplot, base r plot, gt table, flextable, or kable extra} -\item{discrete}{TRUE/FALSE indicate if data input is discrete. Specifically applied to plots.} +\item{discrete}{TRUE/FALSE indicate if data input is discrete. Specifically applied to plots. + +Default: TRUE} } \value{ Add the standard formatting for stock assessment reports for any diff --git a/man/check_label_differences.Rd b/man/check_label_differences.Rd index 06dc1dfc..be1e5497 100644 --- a/man/check_label_differences.Rd +++ b/man/check_label_differences.Rd @@ -11,7 +11,9 @@ check_label_differences(dat, index_variables, id_group = NULL) \item{index_variables}{the index_variables vector created within process_table} -\item{id_group}{the identifying index variable as a string} +\item{id_group}{the identifying index variable as a string + +Default: NULL} } \description{ Create loop to test for differences in column values diff --git a/man/convert_output.Rd b/man/convert_output.Rd index 5dad2c6e..ce7974db 100644 --- a/man/convert_output.Rd +++ b/man/convert_output.Rd @@ -9,14 +9,21 @@ convert_output(file, model = NULL, fleet_names = NULL, save_dir = NULL) \arguments{ \item{file}{Assessment model output file path} -\item{model}{Assessment model used in evaluation ("ss3", "bam", -"fims", "rceattle).} +\item{model}{Assessment model used in evaluation + +Default: NULL + +Options: "ss3", "bam", "fims", "rceattle"} \item{fleet_names}{Names of fleets in the assessment model as shortened in the output file. If fleet names are not properly read, then -indicate the fleets names as an acronym in a vector} +indicate the fleets names as an acronym in a vector + +Default: NULL} + +\item{save_dir}{File path to save the converted output file. -\item{save_dir}{File path to save the converted output file.} +Default: NULL} } \value{ A reformatted and standardized version of assessment model results diff --git a/man/create_rda.Rd b/man/create_rda.Rd index 3e8f13d2..3ca141b8 100644 --- a/man/create_rda.Rd +++ b/man/create_rda.Rd @@ -12,7 +12,6 @@ create_rda( dir = getwd(), year = format(as.POSIXct(Sys.Date(), format = "\%YYYY-\%mm-\%dd"), "\%Y"), ref_line = "msy", - ref_point = "msy", scale_amount = 1, unit_label = "mt", table_df = NULL @@ -28,19 +27,29 @@ create_rda( \item{dat}{Data frame containing data which will fill in captions and alternative text for the object} -\item{dir}{Directory to where the rda will be saved} +\item{dir}{Directory to where the rda will be saved -\item{year}{Default to current year} +Default: the working directory (`getwd()`)} -\item{ref_line}{Reference line value such as "msy", "target" or "unfished"} +\item{year}{Assessment year -\item{ref_point}{Reference point value such as "msy", "target" or "unfished"} +Default: the current year} + +\item{ref_line}{Reference line value + +Default: "msy" + +Options: Including, but not limited to: "msy", "target", "unfished"} \item{scale_amount}{A number describing how much to scale down the quantities shown on the y axis. For example, scale_amount = 100 would scale down a value -from 500,000 --> 5,000. This scale will be reflected in the y axis label.} +from 500,000 --> 5,000. This scale will be reflected in the y axis label. + +Default: 1} + +\item{unit_label}{A string containing a unit label for the y-axis -\item{unit_label}{A string containing a unit label for the y-axis} +Default: "mt"} \item{table_df}{The data frame that the table will be made into for purposes of exporting a latex formatted table.} diff --git a/man/export_rda.Rd b/man/export_rda.Rd index 09cce00b..dfcfe748 100644 --- a/man/export_rda.Rd +++ b/man/export_rda.Rd @@ -14,24 +14,38 @@ export_rda( ) } \arguments{ -\item{object}{The final figure (ggplot) or table (flextable) object.} +\item{object}{The final figure (ggplot) or table (flextable) object. + +Default: NULL} \item{caps_alttext}{The object containing a figure's caption and alternative text, in a list, or a table's caption, likely generated with -stockplotr::extract_caps_alttext().} +stockplotr::extract_caps_alttext(). + +Default: NULL} \item{figures_tables_dir}{If the user has already created folders containing figures and tables ("figures" and "tables"), figures_tables_dir represents the location of these folders. Otherwise, these two folders will be created -automatically, then used to store the exported rda files.} +automatically, then used to store the exported rda files. + +Default: NULL} \item{topic_label}{A string that describes a figure or table's label. These labels are found in the "label" column of the "captions_alt_text.csv" file -and are used to link the figure or table with its caption/alt text.} +and are used to link the figure or table with its caption/alt text. + +Default: NULL} + +\item{fig_or_table}{A string describing whether the plot is a figure or table. + +Default: NULL + +Options: "figure", "table"} -\item{fig_or_table}{A string describing whether the plot is a figure or table.} +\item{latex_table}{The object containing a LaTeX-based table. -\item{latex_table}{The object containing a LaTeX-based table.} +Default: NULL} } \value{ An rda file with a figure's ggplot, caption, and alternative text, or diff --git a/man/extract_caps_alttext.Rd b/man/extract_caps_alttext.Rd index 278ff0f4..9a3c5420 100644 --- a/man/extract_caps_alttext.Rd +++ b/man/extract_caps_alttext.Rd @@ -9,11 +9,17 @@ extract_caps_alttext(topic_label = NULL, fig_or_table = NULL, dir = getwd()) \arguments{ \item{topic_label}{A string that describes a figure or table's label. These labels are found in the "label" column of the "captions_alt_text.csv" file -and are used to link the figure or table with its caption/alt text.} +and are used to link the figure or table with its caption/alt text. -\item{fig_or_table}{A string describing whether the plot is a figure or table.} +Default: NULL} -\item{dir}{The directory containing the "captions_alt_text.csv" file.} +\item{fig_or_table}{A string describing whether the plot is a figure or table. + +Default: NULL} + +\item{dir}{The directory containing the "captions_alt_text.csv" file. + +Default: the working directory (`getwd()`)} } \value{ A figure's caption and alternative text, in a list, or a table's caption. diff --git a/man/filter_data.Rd b/man/filter_data.Rd index a20eaa86..824004b3 100644 --- a/man/filter_data.Rd +++ b/man/filter_data.Rd @@ -17,34 +17,53 @@ filter_data( ) } \arguments{ -\item{dat}{a data frame or list of data frames input as `list()` that -contains the data to be plotted.} +\item{dat}{A tibble or named list of tibbles (input as `list()`) +returned from \link[stockplotr]{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.} \item{label_name}{a string of the name of the label that is used to filter the data.} -\item{module}{(Optional) A string indicating the linked module_name associated -with the label for the plot if known. Default is NULL. By default, the function -will select the most relevant module if more than 1 exists. If selecting more -than one module, place them in a vector such as c("module1", "module2").} +\item{module}{(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()]} + +\item{era}{A string naming the era of data. + +Default: "time" + +Options: "early", "time", "fore" (forecast), or NULL (all data)} + +\item{geom}{A string stating the geom used for the plot. + +Default: "line". + +Options: "line", "point", or "area"} + +\item{group}{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} -\item{era}{A string naming the era of data such as historical ("early"), current ("time"), or -projected ("fore") data if filtering should occur. Default is set to "time" which is -the current time. To plot all data, set era to NULL.} +\item{facet}{A string or vector of strings of a column name. -\item{geom}{Type of plot user wants to create. Options are "line", "point", -and "area".} +Default: NULL} -\item{group}{Name of a column selected grouping for the data.} +\item{scale_amount}{A number to scale the y-axis values. -\item{facet}{a string or vector of strings of a column that facets the data -(e.g. "year", "area", etc.)} +Default: 1} -\item{scale_amount}{A number describing how much to scale down the quantities -shown on the y axis.} +\item{interactive}{A logical value indicating if the environment is interactive. -\item{interactive}{logical. If TRUE, the user will be prompted to select -a module_name when there was more than one found in the filtered data set.} +Default: `FALSE`} } \value{ a data frame that is preformatted for plotting with ggplot2. diff --git a/man/html_all_figs_tables.Rd b/man/html_all_figs_tables.Rd index a04b855e..31ecc069 100644 --- a/man/html_all_figs_tables.Rd +++ b/man/html_all_figs_tables.Rd @@ -8,7 +8,9 @@ html_all_figs_tables(figures_tables_dir = getwd()) } \arguments{ \item{figures_tables_dir}{The location of the folder containing -figures and tables ("figures" and "tables").} +figures and tables ("figures" and "tables"). + +Default: The current working directory (`getwd()`)} } \value{ A folder ("all_tables_figures") in your working directory containing diff --git a/man/plot_aa.Rd b/man/plot_aa.Rd index d14ccfa8..178e7611 100644 --- a/man/plot_aa.Rd +++ b/man/plot_aa.Rd @@ -22,28 +22,43 @@ plot_aa( the target label from \link[stockplotr]{filter_data}} \item{x}{a string of the column name of data used to plot on the x-axis -(default is "year")} + +Default: "year"} \item{y}{a string of the column name of data used to plot on the y-axis -(default is "age")} + +Default: "age"} \item{z}{a string of the column name of data used to control the size of the -bubbles (default is "estimate")} +bubbles + +Default: "estimate"} \item{label}{a string of the label for the size of the bubbles -(default is "Abundance")} -\item{xlab}{a string of the x-axis label (default is "Year")} +Default: "Abundance"} + +\item{xlab}{a string of the x-axis label + +Default: "Year"} -\item{ylab}{a string of the y-axis label (default is "Age")} +\item{ylab}{a string of the y-axis label -\item{facet}{a string or vector of strings of a column that facets the data -(e.g. "sex", "area", etc.). It is not recommended to include more than one -facet due to the complexity of the plot.} +Default: "Age"} + +\item{facet}{a string or vector of strings of a column that facets the data. +It is not recommended to include more than one facet due to the complexity +of the plot. + +Default: NULL + +Options: Including, but not limited to: "sex", "area", "fleet"} \item{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} +is relative to z + +Default: `TRUE`} \item{...}{inherited arguments from internal functions from \link[ggplot2]{geom_point}} diff --git a/man/plot_abundance_at_age.Rd b/man/plot_abundance_at_age.Rd index f28641c0..b3b56c6e 100644 --- a/man/plot_abundance_at_age.Rd +++ b/man/plot_abundance_at_age.Rd @@ -17,31 +17,43 @@ plot_abundance_at_age( \arguments{ \item{dat}{A data frame returned from \link[stockplotr]{convert_output}} -\item{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.} +\item{facet}{a string or vector of strings of a column that facets the data. +Set facet = "none" to summarize the data in a single plot. -\item{unit_label}{units for abundance} +Default: NULL + +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", +NULL} + +\item{unit_label}{units for abundance + +Default: "fish"} \item{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.} +in the legend label if proportional is set to FALSE. + +Default: 1,000} \item{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} +is relative to z + +Default: `TRUE`} \item{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.} + +Default: `FALSE`} \item{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.} + +Default: the working directory (`getwd()`)} } \value{ A plot showing total abundance (or numbers) at age. diff --git a/man/plot_biomass.Rd b/man/plot_biomass.Rd index 794e45f3..f4276339 100644 --- a/man/plot_biomass.Rd +++ b/man/plot_biomass.Rd @@ -11,7 +11,7 @@ plot_biomass( facet = NULL, ref_line = "msy", era = NULL, - unit_label = "metric tons", + unit_label = "mt", module = NULL, scale_amount = 1, relative = FALSE, @@ -34,25 +34,28 @@ Default: "line". Options: "line", "point", or "area"} -\item{group}{A string of a single column that groups the data (e.g. "fleet", -"sex", "area", etc.). +\item{group}{A string of a single column that groups the data. Set group = "none" to summarize data over all indexing values. -Default: NULL} +Default: NULL +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{facet}{A string or vector of strings of a column name. Default: NULL} \item{ref_line}{A string specifying the type of reference you want to -compare biomass to. The default is `"msy"`, which 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 but 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`. Other possibilities may include -"target", "MSY", and "unfished".} + 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"} \item{era}{A string naming the era of data. @@ -60,9 +63,12 @@ Default: "time" Options: "early", "time", "fore" (forecast), or NULL (all data)} -\item{unit_label}{units for biomass} +\item{unit_label}{units for biomass + +Default: "mt"} \item{module}{(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 diff --git a/man/plot_biomass_at_age.Rd b/man/plot_biomass_at_age.Rd index cd8fe3b1..854e979e 100644 --- a/man/plot_biomass_at_age.Rd +++ b/man/plot_biomass_at_age.Rd @@ -10,7 +10,7 @@ plot_biomass_at_age( unit_label = "mt", scale_amount = 1000, proportional = TRUE, - interactive = FALSE, + interactive = TRUE, make_rda = FALSE, figures_dir = getwd() ) @@ -18,33 +18,47 @@ plot_biomass_at_age( \arguments{ \item{dat}{A data frame returned from \link[stockplotr]{convert_output}} -\item{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.} +\item{facet}{a string or vector of strings of a column that facets the data. +Set facet = "none" to summarize the data in a single plot. -\item{unit_label}{units for abundance} +Default: NULL + +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", +NULL} + +\item{unit_label}{units for abundance + +Default: "fish"} \item{scale_amount}{A number describing how much to scale down the biomass at age. For example, scale_amount = 100 would scale down a value from 500,000 --> 5,000. This scale will be reflected in the legend label if -proportion is set to FALSE.} +proportion is set to FALSE. + +Default: 1,000} \item{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} +is relative to z + +Default: `TRUE`} \item{interactive}{TRUE/FALSE; indicate whether the environment in which the function is operating is interactive. This bypasses some options for -filtering when preparing data for the plot. Default is FALSE.} +filtering when preparing data for the plot. + +Default: `TRUE`} \item{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.} + +Default: `FALSE`} \item{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.} + +Default: the working directory (`getwd()`)} } \value{ A plot showing total biomass at age. diff --git a/man/plot_catch_comp.Rd b/man/plot_catch_comp.Rd index 800cdc2d..5c22dc18 100644 --- a/man/plot_catch_comp.Rd +++ b/man/plot_catch_comp.Rd @@ -20,43 +20,61 @@ plot_catch_comp( \arguments{ \item{dat}{A data frame returned from \link[stockplotr]{convert_output}} -\item{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.} +\item{facet}{a string or vector of strings of a column that facets the data. +Set facet = "none" to summarize the data in a single plot. -\item{era}{a string naming the era of data such as historical ("early"), current ("time"), or -projected ("fore") data if filtering should occur. Default is set to "time" which is -the current time. To plot all data, set era to NULL.} +Default: NULL -\item{unit_label}{indicate the name of the units of catch as to label the axis} +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", +NULL} + +\item{era}{A string naming the era of data. + +Default: "time" + +Options: "early", "time", "fore" (forecast), or NULL (all data)} + +\item{unit_label}{indicate the name of the units of catch as to label the axis + +Default: "mt"} \item{scale_amount}{A number describing how much to scale down the catch 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 catch in hundreds of the 'unit_label'. This scale will be reflected -in the legend label if proportional is set to FALSE. The default is 1.} +in the legend label if proportional is set to FALSE. + +Default: 1} \item{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} +is relative to z -\item{interactive}{TRUE/FALSE; indicate whether the environment in which the -function is operating is interactive. This bypasses some options for -filtering when preparing data for the plot. Default is FALSE.} +Default: `TRUE`} -\item{module}{(Optional) A string indicating the linked module_name associated -with the label for the plot if known. Default is NULL. By default, the function -will select the most relevant module if more than 1 exists.} +\item{interactive}{A logical value indicating if the environment is interactive. + +Default: `FALSE`} + +\item{module}{(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()]} \item{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.} + +Default: `FALSE`} \item{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.} + +Default: the working directory (`getwd()`)} } \value{ A plot showing catch or landings composition. diff --git a/man/plot_error.Rd b/man/plot_error.Rd index 6257ee30..33223fac 100644 --- a/man/plot_error.Rd +++ b/man/plot_error.Rd @@ -19,29 +19,46 @@ plot_error( } \arguments{ \item{dat}{filtered data frame from standard output file(s) preformatted for -the target label from \link[stockplotr]{process_data}} +the target label from \link[stockplotr]{filter_data}} -\item{x}{a string of the column name of data used to plot on the x-axis (default -is "year")} +\item{x}{a string of the column name of data used to plot on the x-axis -\item{y}{a string of the column name of data used to plot on the y-axis (default -is "estimate")} +Default: "year"} + +\item{y}{a string of the column name of data used to plot on the y-axis + +Default: "estimate"} \item{geom}{type of geom to use for plotting found in ggplot2 (e.g. "point", -"line", etc.). Default is "line". Other options are "point" and "area".} +"line", etc.). + +Default: "line" + +Options: "point" and "area"} + +\item{group}{a string of a single column that groups the data. +Currently can only have one level of grouping. -\item{group}{a string of a single column that groups the data (e.g. "fleet", -"sex", "area", etc.). Currently can only have one level of grouping.} +Default: NULL +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{facet}{a string or vector of strings of a column that facets the data -(e.g. "year", "area", etc.)} +(e.g. "year", "area", etc.) -\item{xlab}{a string of the x-axis label (default is "Year")} +Default: NULL} + +\item{xlab}{a string of the x-axis label + +Default: "Year"} \item{ylab}{a string of the y-axis label. If NULL, it will be set to the name -of `y`.} + of `y`. + +Default: NULL} + +\item{hline}{indicate true or false to place a horizontal line at 1 -\item{hline}{indicate true or false to place a horizontal line at 1} +Default: `TRUE`} \item{...}{inherited arguments from internal functions from ggplot2::geom_xx} } diff --git a/man/plot_fishing_mortality.Rd b/man/plot_fishing_mortality.Rd index 7b7305e7..83ea75e6 100644 --- a/man/plot_fishing_mortality.Rd +++ b/man/plot_fishing_mortality.Rd @@ -31,12 +31,12 @@ Default: "line". Options: "line", "point", or "area"} -\item{group}{A string of a single column that groups the data (e.g. "fleet", -"sex", "area", etc.). +\item{group}{A string of a single column that groups the data. Set group = "none" to summarize data over all indexing values. -Default: NULL} +Default: NULL +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{facet}{A string or vector of strings of a column name. @@ -56,6 +56,7 @@ Default: "time" Options: "early", "time", "fore" (forecast), or NULL (all data)} \item{module}{(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 diff --git a/man/plot_indices.Rd b/man/plot_indices.Rd index ce695a27..cec8ad08 100644 --- a/man/plot_indices.Rd +++ b/man/plot_indices.Rd @@ -24,23 +24,29 @@ returned from \link[stockplotr]{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.} -\item{unit_label}{units for index of abundance/CPUE} +\item{unit_label}{units for index of abundance/CPUE -\item{group}{A string of a single column that groups the data (e.g. "fleet", -"sex", "area", etc.). +Default: ""} + +\item{group}{A string of a single column that groups the data. Set group = "none" to summarize data over all indexing values. -Default: NULL} +Default: NULL +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} + +\item{facet}{a string or vector of strings of a column that facets the data. "fleet" is always added on to any faceting selections -\item{facet}{a string or vector of strings of a column that facets the data -(e.g. "year", "area", etc.) "fleet" is always added on to any faceting selections} +Default: NULL + +Options: May include, but is not limited to: "fleet", "year", "area", NULL} \item{interactive}{A logical value indicating if the environment is interactive. Default: `FALSE`} \item{module}{(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 @@ -48,7 +54,9 @@ If the interactive and >1 module_name is found, user will select the module_name in the console. @seealso [filter_data()]} \item{focus}{a string or vector of strings indicating how data should be -filtered. (i.e. select names of fleets to zoom into the plot)} +filtered. (i.e. select names of fleets to zoom into the plot) + +Default: NULL} \item{make_rda}{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, diff --git a/man/plot_landings.Rd b/man/plot_landings.Rd index 534fde54..edcb43de 100644 --- a/man/plot_landings.Rd +++ b/man/plot_landings.Rd @@ -6,7 +6,7 @@ \usage{ plot_landings( dat, - unit_label = "metric tons", + unit_label = "mt", geom = "line", group = NULL, facet = NULL, @@ -29,7 +29,7 @@ in `ref_line` is used to plot a reference line or calculate relative spawning bi \item{unit_label}{A string specifying spawning biomass unit. -Default: "metric tons"} +Default: "mt"} \item{geom}{A string stating the geom used for the plot. @@ -37,12 +37,12 @@ Default: "line". Options: "line", "point", or "area"} -\item{group}{A string of a single column that groups the data (e.g. "fleet", -"sex", "area", etc.). +\item{group}{A string of a single column that groups the data. Set group = "none" to summarize data over all indexing values. -Default: NULL} +Default: NULL +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{facet}{A string or vector of strings of a column name. @@ -50,7 +50,7 @@ Default: NULL} \item{lbs}{A logical value indicating whether to convert the y-axis values from kilograms to pounds. The default units match the default in the -unit_label argument - 'metric tons'. +unit_label argument - 'mt'. Default: `FALSE`} @@ -65,6 +65,7 @@ Options: "early", "time", "fore" (forecast), or NULL (all data)} Default: 1} \item{module}{(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 diff --git a/man/plot_natural_mortality.Rd b/man/plot_natural_mortality.Rd index 97885ed7..7363a494 100644 --- a/man/plot_natural_mortality.Rd +++ b/man/plot_natural_mortality.Rd @@ -23,12 +23,12 @@ returned from \link[stockplotr]{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.} -\item{group}{A string of a single column that groups the data (e.g. "fleet", -"sex", "area", etc.). +\item{group}{A string of a single column that groups the data. Set group = "none" to summarize data over all indexing values. -Default: NULL} +Default: NULL +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{facet}{A string or vector of strings of a column name. @@ -45,6 +45,7 @@ Options: "early", "time", "fore" (forecast), or NULL (all data)} Default: `FALSE`} \item{module}{(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 diff --git a/man/plot_obsvpred.Rd b/man/plot_obsvpred.Rd index a0e2ed1a..1799d40a 100644 --- a/man/plot_obsvpred.Rd +++ b/man/plot_obsvpred.Rd @@ -22,29 +22,47 @@ plot_obsvpred( \item{dat}{filtered data frame from standard output file(s) preformatted for the target label from \link[stockplotr]{filter_data}} -\item{x}{a string of the column name of data used to plot on the x-axis (default -is "year")} +\item{x}{a string of the column name of data used to plot on the x-axis -\item{y}{a string of the column name of data used to plot on the y-axis (default -is "estimate")} +Default: "year"} -\item{observed_label}{a string of the label used to filter the observed data. Default is "observed".} +\item{y}{a string of the column name of data used to plot on the y-axis -\item{predicted_label}{a string of the label used to filter the predicted data. Default is "predicted".} +Default: "estimate"} + +\item{observed_label}{a string of the label used to filter the observed data + +Default: "observed"} + +\item{predicted_label}{a string of the label used to filter the predicted data +Default: "predicted"} \item{geom}{type of geom to use for plotting found in ggplot2 (e.g. "point", -"line", etc.). Default is "line". Other options are "point" and "area".} +"line", etc.). + +Default: "line" + +Options: "point" and "area"} -\item{xlab}{a string of the x-axis label (default is "Year")} +\item{xlab}{a string of the x-axis label + +Default: "Year"} \item{ylab}{a string of the y-axis label. If NULL, it will be set to the name -of `y`.} + of `y`. + +Default: NULL} -\item{group}{a string of a single column that groups the data (e.g. "fleet", -"sex", "area", etc.). Currently can only have one level of grouping.} +\item{group}{a string of a single column that groups the data. +Currently can only have one level of grouping. + +Default: NULL +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{facet}{a string or vector of strings of a column that facets the data -(e.g. "year", "area", etc.)} +(e.g. "year", "area", etc.) + +Default: NULL} \item{...}{inherited arguments from internal functions from ggplot2::geom_xx} } diff --git a/man/plot_recruitment.Rd b/man/plot_recruitment.Rd index 90db10fc..df79db39 100644 --- a/man/plot_recruitment.Rd +++ b/man/plot_recruitment.Rd @@ -25,7 +25,9 @@ returned from \link[stockplotr]{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.} -\item{unit_label}{units for recruitment} +\item{unit_label}{units for recruitment + +Default: "mt"} \item{scale_amount}{A number to scale the y-axis values. @@ -37,12 +39,12 @@ Default: "time" Options: "early", "time", "fore" (forecast), or NULL (all data)} -\item{group}{A string of a single column that groups the data (e.g. "fleet", -"sex", "area", etc.). +\item{group}{A string of a single column that groups the data. Set group = "none" to summarize data over all indexing values. -Default: NULL} +Default: NULL +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{facet}{A string or vector of strings of a column name. @@ -53,6 +55,7 @@ Default: NULL} Default: `FALSE`} \item{module}{(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 diff --git a/man/plot_recruitment_deviations.Rd b/man/plot_recruitment_deviations.Rd index 50e5e034..835bc532 100644 --- a/man/plot_recruitment_deviations.Rd +++ b/man/plot_recruitment_deviations.Rd @@ -22,6 +22,7 @@ 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.} \item{module}{(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 diff --git a/man/plot_spawning_biomass.Rd b/man/plot_spawning_biomass.Rd index fff4f851..c5a53c69 100644 --- a/man/plot_spawning_biomass.Rd +++ b/man/plot_spawning_biomass.Rd @@ -10,7 +10,7 @@ plot_spawning_biomass( group = NULL, facet = NULL, ref_line = "msy", - unit_label = "metric tons", + unit_label = "mt", era = NULL, lbs = FALSE, module = NULL, @@ -35,12 +35,12 @@ Default: "line". Options: "line", "point", or "area"} -\item{group}{A string of a single column that groups the data (e.g. "fleet", -"sex", "area", etc.). +\item{group}{A string of a single column that groups the data. Set group = "none" to summarize data over all indexing values. -Default: NULL} +Default: NULL +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{facet}{A string or vector of strings of a column name. @@ -55,7 +55,7 @@ If the reference point is not found in the data, set ref_line = c("name" = value \item{unit_label}{A string specifying spawning biomass unit. -Default: "metric tons"} +Default: "mt"} \item{era}{A string naming the era of data. @@ -65,11 +65,12 @@ Options: "early", "time", "fore" (forecast), or NULL (all data)} \item{lbs}{A logical value indicating whether to convert the y-axis values from kilograms to pounds. The default units match the default in the -unit_label argument - 'metric tons'. +unit_label argument - 'mt'. Default: `FALSE`} \item{module}{(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 diff --git a/man/plot_stock_recruitment.Rd b/man/plot_stock_recruitment.Rd index 71049367..abcfa2c9 100644 --- a/man/plot_stock_recruitment.Rd +++ b/man/plot_stock_recruitment.Rd @@ -23,14 +23,20 @@ returned from \link[stockplotr]{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.} -\item{spawning_biomass_label}{Units for spawning biomass} +\item{spawning_biomass_label}{Units for spawning biomass -\item{recruitment_label}{units for recruitment} +Default: "mt"} + +\item{recruitment_label}{units for recruitment + +Default: "mt"} \item{interactive}{Indicate whether the environment the plot is being made in is interactive. By default, this is set to false. If true, dependent on your data, a -option menu will pop-up.} +option menu will pop-up. + +Default: TRUE} \item{era}{A string naming the era of data. @@ -39,6 +45,7 @@ Default: "time" Options: "early", "time", "fore" (forecast), or NULL (all data)} \item{module}{(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 diff --git a/man/plot_timeseries.Rd b/man/plot_timeseries.Rd index e9c81a13..a9ef54b5 100644 --- a/man/plot_timeseries.Rd +++ b/man/plot_timeseries.Rd @@ -20,25 +20,40 @@ plot_timeseries( \item{dat}{filtered data frame from standard output file(s) preformatted for the target label from \link[stockplotr]{filter_data}} -\item{x}{a string of the column name of data used to plot on the x-axis (default -is "year")} +\item{x}{a string of the column name of data used to plot on the x-axis -\item{y}{a string of the column name of data used to plot on the y-axis (default -is "estimate")} +Default: "year"} + +\item{y}{a string of the column name of data used to plot on the y-axis + +Default: "estimate"} \item{geom}{type of geom to use for plotting found in ggplot2 (e.g. "point", -"line", etc.). Default is "line". Other options are "point" and "area".} +"line", etc.). + +Default: "line" + +Options: "point" and "area"} -\item{xlab}{a string of the x-axis label (default is "Year")} +\item{xlab}{a string of the x-axis label + +Default: "Year"} \item{ylab}{a string of the y-axis label. If NULL, it will be set to the name -of `y`.} + of `y`. + +Default: NULL} -\item{group}{a string of a single column that groups the data (e.g. "fleet", -"sex", "area", etc.). Currently can only have one level of grouping.} +\item{group}{a string of a single column that groups the data. +Currently can only have one level of grouping. + +Default: NULL +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{facet}{a string or vector of strings of a column that facets the data -(e.g. "year", "area", etc.)} +(e.g. "year", "area", etc.) + +Default: NULL} \item{...}{inherited arguments from internal functions from ggplot2::geom_xx} } diff --git a/man/process_data.Rd b/man/process_data.Rd index ce7bb7cb..e37c57a1 100644 --- a/man/process_data.Rd +++ b/man/process_data.Rd @@ -10,11 +10,19 @@ process_data(dat, group = NULL, facet = NULL, lbs = FALSE, method = "sum") \item{dat}{Pre-filtered data from \link[stockplotr]{filter_data} following a long format data.} -\item{group}{A string identifying the indexing variable of the data. If you -want to just summarize the data across all factors, set group = "none".} +\item{group}{A string identifying the indexing variable of the data. +To remove any groups and summarize data across all factors, set +group = "none". Setting group = NULL will keep any grouping +variables identified in the data by the function. + +Default: NULL + +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{facet}{A string or vector of strings identifying the faceting -variable(s) of the data.} +variable(s) of the data. + +Default: NULL} \item{lbs}{A logical value indicating whether to convert the y-axis values from kilograms to pounds. The default units match the default in the @@ -23,7 +31,11 @@ unit_label argument - 'metric tons'. Default: `FALSE`} \item{method}{A string describing the method of summarizing data when group -is set to "none". Options are "sum" or "mean". Default is "sum".} +is set to "none". + +Default: "sum" + +Options: "sum" or "mean"} } \value{ List of 3 objects: diff --git a/man/process_table.Rd b/man/process_table.Rd index d833c106..7ac74872 100644 --- a/man/process_table.Rd +++ b/man/process_table.Rd @@ -10,13 +10,25 @@ process_table(dat, group = NULL, method = "sum", label = NULL) \item{dat}{Pre-filtered data from \link[stockplotr]{filter_data} following a long format data.} -\item{group}{A string identifying the indexing variable of the data. If you -want to just summarize the data across all factors, set group = "none".} +\item{group}{A string identifying the indexing variable of the data. +To remove any groups and summarize data across all factors, set +group = "none". Setting group = NULL will keep any grouping +variables identified in the data by the function. + +Default: NULL + +Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL} \item{method}{A string describing the method of summarizing data when group -is set to "none". Options are "sum" or "mean". Default is "sum".} +is set to "none". + +Default: "sum" + +Options: "sum" or "mean"} + +\item{label}{A string or vector of strings identifying the label values to filter the data. -\item{label}{A string or vector of strings identifying the label values to filter the data.} +Default: NULL} } \value{ A dataframe of processed data ready for formatting into a table. @@ -31,7 +43,7 @@ Input is an object created with \link[stockplotr]{filter_data}. { filtered <- filter_data( dat = stockplotr:::example_data, - label_name = "landings", + label = "landings", geom = "line", era = "time" ) diff --git a/man/reference_line.Rd b/man/reference_line.Rd index fc8fade9..6f0b390d 100644 --- a/man/reference_line.Rd +++ b/man/reference_line.Rd @@ -14,8 +14,9 @@ reference_line(plot, dat, label_name, reference, scale_amount = 1, lbs = FALSE) \item{label_name}{string of the name of the quantity that users want to extract the reference point from} -\item{reference}{string. name of the reference point such as "msy", -"unfished", or "target"} +\item{reference}{string of the reference point + +Options: Including, but not limited to: "msy", "unfished", "target"} \item{scale_amount}{A number to scale the y-axis values. @@ -23,7 +24,7 @@ Default: 1} \item{lbs}{A logical value indicating whether to convert the y-axis values from kilograms to pounds. The default units match the default in the -unit_label argument - 'metric tons'. +unit_label argument - 'mt'. Default: `FALSE`} } diff --git a/man/save_all_plots.Rd b/man/save_all_plots.Rd index 27b18a22..45bc0e8a 100644 --- a/man/save_all_plots.Rd +++ b/man/save_all_plots.Rd @@ -35,26 +35,34 @@ returned from \link[stockplotr]{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.} -\item{recruitment_unit_label}{Units for recruitment} +\item{recruitment_unit_label}{Units for recruitment + +Default: "mt"} \item{recruitment_scale_amount}{A number describing how much to scale down the recruitment quantities shown on the y axis. For example, recruitment_scale_amount = 100 would scale down a value from 500,000 --> -5,000. This scale will be reflected in the y axis label.} +5,000. This scale will be reflected in the y axis label. + +Default: 1} \item{relative}{A logical value specifying to set y-axis values relative to the ref_line value. Default: `FALSE`} -\item{proportional}{T/F to scale size of bubble plots} +\item{proportional}{T/F to scale size of bubble plots + +Default: `TRUE`} \item{interactive}{A logical value indicating if the environment is interactive. Default: `FALSE`} \item{figures_tables_dir}{The location of the folder containing -figures and tables ("figures" and "tables").} +figures and tables ("figures" and "tables"). + +Default: the working directory (`getwd()`)} \item{ref_line}{A string specifying the type of reference you want to compare biomass to. The default is `"msy"`, which looks for @@ -64,39 +72,71 @@ lower-case letters but 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`. Other possibilities may include "target", "MSY", and "unfished". When the reference cannot be found, -indicate the reference line in the form c("label" = value).} +indicate the reference line in the form c("label" = value). + +Default: "msy" + +Options: Including, but not limited to: "target", "MSY", "unfished"} \item{biomass_scale_amount}{A number describing how much to scale down the -biomass quantities shown on the y axis. See `recruitment_scale_amount`.} +biomass quantities shown on the y axis. See `recruitment_scale_amount`. + +Default: 1} + +\item{landings_unit_label}{Units for landings -\item{landings_unit_label}{Units for landings} +Default: "mt"} -\item{spawning_biomass_label}{Units for spawning biomass} +\item{spawning_biomass_label}{Units for spawning biomass + +Default: "mt"} \item{spawning_biomass_scale_amount}{A number describing how much to scale down the -spawning biomass quantities shown on the y axis. See `recruitment_scale_amount`.} +spawning biomass quantities shown on the y axis. See `recruitment_scale_amount`. + +Default: 1} \item{ref_line_sb}{Identical definition as `ref_line`, but this argument is -applied to plot_spawning_biomass.} +applied to plot_spawning_biomass. + +Default: "msy" + +Options: Including, but not limited to: "target", "MSY", "unfished"} \item{abundance_at_age_scale_amount}{A number describing how much to scale down the -abundance quantities shown via bubble size. See `recruitment_scale_amount`.} +abundance quantities shown via bubble size. See `recruitment_scale_amount`. + +Default: 1} -\item{abundance_at_age_unit_label}{Abbreviated units for abundance at age} +\item{abundance_at_age_unit_label}{Abbreviated units for abundance at age + +Default: "fish"} \item{biomass_at_age_scale_amount}{A number describing how much to scale down the -biomass quantities shown via bubble size. See `recruitment_scale_amount`.} +biomass quantities shown via bubble size. See `recruitment_scale_amount`. + +Default: 1} -\item{biomass_at_age_unit_label}{Abbreviated units for biomass at age} +\item{biomass_at_age_unit_label}{Abbreviated units for biomass at age -\item{indices_unit_label}{Units for index of abundance/CPUE} +Default: "mt"} -\item{biomass_unit_label}{Abbreviated units for biomass} +\item{indices_unit_label}{Units for index of abundance/CPUE -\item{catch_unit_label}{Abbreviated units for catch} +Default: ""} + +\item{biomass_unit_label}{Abbreviated units for biomass + +Default: "mt"} + +\item{catch_unit_label}{Abbreviated units for catch + +Default: "mt"} \item{catch_scale_amount}{A number describing how much to scale down the -catch quantities shown via bubble size. See `recruitment_scale_amount`.} +catch quantities shown via bubble size. See `recruitment_scale_amount`. + +Default: 1} } \value{ Rda files for each figure/table. diff --git a/man/stockplotr-package.Rd b/man/stockplotr-package.Rd index ce67c60e..0dcd782c 100644 --- a/man/stockplotr-package.Rd +++ b/man/stockplotr-package.Rd @@ -22,6 +22,7 @@ Useful links: Authors: \itemize{ + \item Samantha Schiano \email{samantha.schiano@noaa.gov} (\href{https://orcid.org/0009-0003-3744-6428}{ORCID}) \item Sophie Breitbart \email{sophie.breitbart@noaa.gov} (\href{https://orcid.org/0000-0001-9641-9786}{ORCID}) [contributor] \item Steve Saul \email{steven.saul@noaa.gov} } diff --git a/man/table_landings.Rd b/man/table_landings.Rd index 1e07bc63..26d16271 100644 --- a/man/table_landings.Rd +++ b/man/table_landings.Rd @@ -24,7 +24,9 @@ returned from \link[stockplotr]{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.} -\item{unit_label}{Abbreviated units of landings} +\item{unit_label}{Abbreviated units of landings + +Default: "mt"} \item{era}{A string naming the era of data. @@ -36,13 +38,22 @@ Options: "early", "time", "fore" (forecast), or NULL (all data)} Default: `FALSE`} -\item{group}{A string identifying the indexing variable of the data. If you -want to just summarize the data across all factors, set group = "none".} +\item{group}{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} \item{method}{A string describing the method of summarizing data when group -is set to "none". Options are "sum" or "mean". Default is "sum".} +is set to "none". + +Default: "sum" + +Options: "sum" or "mean"} \item{module}{(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 @@ -52,7 +63,9 @@ module_name in the console. @seealso [filter_data()]} \item{label}{The label that will be chosen from the input file. If unspecified, the function will search the "label" column and use the first matching label in this ordered list: "landings_weight", "landings_numbers", "landings_expected", -"landings_predicted", "landings".} +"landings_predicted", "landings". + +Default: NULL} \item{make_rda}{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, @@ -61,7 +74,9 @@ the rda will be exported to the folder indicated in the argument "figures_dir". Default: `FALSE`.} \item{tables_dir}{The location of the folder containing the generated table -rda files ("tables") that will be created if the argument `make_rda` = TRUE.} +rda files ("tables") that will be created if the argument `make_rda` = TRUE. + +Default: the working directory (`getwd()`)} } \value{ A table ready of landed catch by fleet and year. diff --git a/man/theme_noaa.Rd b/man/theme_noaa.Rd index 33d5d509..f84550ad 100644 --- a/man/theme_noaa.Rd +++ b/man/theme_noaa.Rd @@ -7,7 +7,9 @@ theme_noaa(discrete = TRUE, ...) } \arguments{ -\item{discrete}{Variable indicating whether the color or fill aesthetic is discrete. Default is TRUE.} +\item{discrete}{Variable indicating whether the color or fill aesthetic is discrete. + +Default: TRUE} \item{...}{Arguments passed to `ggplot2::theme()`.} }