diff --git a/R/plot_biomass.R b/R/plot_biomass.R index 9c7acec..2a66907 100644 --- a/R/plot_biomass.R +++ b/R/plot_biomass.R @@ -136,7 +136,8 @@ plot_total_biomass <- function(dat, export_rda(plt_fin = plt_fin, caps_alttext = caps_alttext, rda_folder = rda_folder, - topic_label = topic_label) + topic_label = topic_label, + fig_or_table = fig_or_table) } diff --git a/R/plot_recruitment.R b/R/plot_recruitment.R index cfdb1f9..bb0d5ab 100644 --- a/R/plot_recruitment.R +++ b/R/plot_recruitment.R @@ -195,7 +195,8 @@ plot_recruitment <- function(dat, export_rda(plt_fin = plt_fin, caps_alttext = caps_alttext, rda_folder = rda_folder, - topic_label = topic_label) + topic_label = topic_label, + fig_or_table = fig_or_table) } diff --git a/R/plot_spawning_biomass.R b/R/plot_spawning_biomass.R index 31ba366..bc9fe93 100644 --- a/R/plot_spawning_biomass.R +++ b/R/plot_spawning_biomass.R @@ -28,7 +28,7 @@ plot_spawning_biomass <- function( ref_line = c("target", "unfished"), end_year = NULL, relative = FALSE, - export_rda = FALSE, + make_rda = FALSE, rda_folder = getwd() ) { @@ -145,12 +145,13 @@ plot_spawning_biomass <- function( ) # export figure to rda if argument = T - if (export_rda == TRUE){ + if (make_rda == TRUE){ export_rda(plt_fin = plt_fin, caps_alttext = caps_alttext, rda_folder = rda_folder, - topic_label = topic_label) + topic_label = topic_label, + fig_or_table = fig_or_table) } return(plt_fin) diff --git a/R/table_indices.R b/R/table_indices.R index 4fc56c0..0d47856 100644 --- a/R/table_indices.R +++ b/R/table_indices.R @@ -55,7 +55,8 @@ table_indices <- function(dat, export_rda(plt_fin = plt_fin, caps_alttext = caps_alttext, rda_folder = rda_folder, - topic_label = topic_label) + topic_label = topic_label, + fig_or_table = fig_or_table) } diff --git a/R/utils.R b/R/utils.R index e03c778..f77b669 100644 --- a/R/utils.R +++ b/R/utils.R @@ -39,7 +39,8 @@ extract_caps_alttext <- function(topic_label, export_rda <- function(plt_fin = plt_fin, caps_alttext = caps_alttext, rda_folder = rda_folder, - topic_label = topic_label){ + topic_label = topic_label, + fig_or_table = fig_or_table){ # make rda for figures if (fig_or_table == "figure") { diff --git a/man/plot_landings.Rd b/man/plot_landings.Rd index 4b5f870..19711cb 100644 --- a/man/plot_landings.Rd +++ b/man/plot_landings.Rd @@ -4,12 +4,16 @@ \alias{plot_landings} \title{Plot observed landings by fleet} \usage{ -plot_landings(dat, units = NULL) +plot_landings(dat, units = NULL, make_rda = FALSE, rda_folder = getwd()) } \arguments{ \item{dat}{A data frame returned from `asar::convert_output()`.} \item{units}{indicate the name of the units of landings as to label the axis} + +\item{rda_folder}{The location of the folder containing the generated .rda files +("rda_files") that will be created if the argument `export_rda` = TRUE. +Default is the working directory.} } \value{ Create a plot ready for a stock assessment report of cumulative landings diff --git a/man/plot_recruitment.Rd b/man/plot_recruitment.Rd index c8f6da9..6186fe8 100644 --- a/man/plot_recruitment.Rd +++ b/man/plot_recruitment.Rd @@ -15,7 +15,9 @@ plot_recruitment( scale_amount = NULL, show_warnings = FALSE, end_year = NULL, - return = "recruitment" + return = "recruitment", + make_rda = FALSE, + rda_folder = getwd() ) } \arguments{ @@ -42,6 +44,15 @@ and following with R units.} \item{end_year}{last year of assessment} \item{return}{Default returns recruitment over time. Options to display recruitment time series, stock recruitment curve, or recruitment fit} + +\item{rda_folder}{The location of the folder containing the generated .rda files +("rda_files") that will be created if the argument `export_rda` = TRUE. +Default is the working directory.} + +\item{export_rda}{TRUE/FALSE; indcate 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_folder". +Default is FALSE.} } \value{ A series of plots are exported including recruitment over time with R0 diff --git a/man/plot_spawning_biomass.Rd b/man/plot_spawning_biomass.Rd index eb014f1..b84dd65 100644 --- a/man/plot_spawning_biomass.Rd +++ b/man/plot_spawning_biomass.Rd @@ -10,7 +10,9 @@ plot_spawning_biomass( scale_amount = 1, ref_line = c("target", "unfished"), end_year = NULL, - relative = FALSE + relative = FALSE, + make_rda = FALSE, + rda_folder = getwd() ) } \arguments{ @@ -31,6 +33,10 @@ regardless of how it is specified in `dat`.} \item{relative}{A logical value specifying if the resulting figures should be relative spawning biomass. The default is `FALSE`. `ref_line` indicates which reference point to use.} + +\item{rda_folder}{The location of the folder containing the generated .rda files +("rda_files") that will be created if the argument `export_rda` = TRUE. +Default is the working directory.} } \value{ Plot spawning biomass from the results of an assessment model translated to diff --git a/man/plot_total_biomass.Rd b/man/plot_total_biomass.Rd index 9cb7f5a..00fa09e 100644 --- a/man/plot_total_biomass.Rd +++ b/man/plot_total_biomass.Rd @@ -12,7 +12,9 @@ plot_total_biomass( scale_amount = 1000, ref_line = c("target", "MSY", "msy", "unfished"), end_year = NULL, - relative = FALSE + relative = FALSE, + make_rda = FALSE, + rda_folder = getwd() ) } \arguments{ @@ -33,6 +35,10 @@ in relative totb calculations} projections). This parameter will be deprecated once the output converter is fully developed.} \item{relative}{Plot relative total biomass. Ref line indicates which reference point to use} + +\item{rda_folder}{The location of the folder containing the generated .rda files +("rda_files") that will be created if the argument `export_rda` = TRUE. +Default is the working directory.} } \value{ Plot total biomass from a stock assessment model as found in a NOAA diff --git a/man/table_indices.Rd b/man/table_indices.Rd index 392b69a..dd13ac3 100644 --- a/man/table_indices.Rd +++ b/man/table_indices.Rd @@ -4,10 +4,14 @@ \alias{table_indices} \title{Create Indices of Abundance Table} \usage{ -table_indices(dat) +table_indices(dat, make_rda = FALSE, rda_folder = getwd()) } \arguments{ \item{dat}{A data frame returned from `asar::convert_output()`.} + +\item{rda_folder}{The location of the folder containing the generated .rda files +("rda_files") that will be created if the argument `export_rda` = TRUE. +Default is the working directory.} } \value{ Create table of observed annual indices of abundance plus error