diff --git a/R/convert_output.R b/R/convert_output.R index 3edb5bc8..adfc503d 100644 --- a/R/convert_output.R +++ b/R/convert_output.R @@ -2,21 +2,29 @@ #' #' Format stock assessment output file to a standardized tibble. #' -#' @param files List of Paths. Assessment model output file paths. Currently accepts SS3 +#' @param files List of paths. Assessment model output file paths. Currently accepts SS3 #' `r4ss::ss_output()` or Report.sso file (being deprecated), BAM .rda file, Rceattle model object, #' and FIMS output (the tibble returned by `FIMS::get_estimates()`, a `FIMSFit` object, or an .rds #' file with either). If multiple elements, all valid models will be read, converted, and #' appended together. #' #' `names(files)` will be used as the name of the model in the output. +#' +#' @param file `r lifecycle::badge('deprecated')` +#' This argument was deprecated in favor of the `files` argument in order +#' to clarify that multiple files can be processed simultaneously. #' -#' @param models Character vector Assessment model used in evaluation +#' @param models Character vector. Assessment model used in evaluation #' #' Default: NULL #' #' Options: "ss3", "bam", "fims", "rceattle" #' #' Should match length of `files` if >1 model. +#' +#' @param model `r lifecycle::badge('deprecated')` +#' This argument was deprecated in favor of the `models` argument in order +#' to clarify that multiple models can be processed simultaneously. #' #' @param fleet_names List of named character vectors. Names of fleets in the assessment model as #' shortened in the output file or names of fleets to replace the native fleet @@ -84,8 +92,29 @@ convert_output <- function( models = NULL, fleet_names = NULL, save_dir = NULL, - start_year = NULL + start_year = NULL, + file = lifecycle::deprecated(), + model = lifecycle::deprecated() ) { + # check for used deprecated arguments + if (lifecycle::is_present(file)) { + lifecycle::deprecate_warn( + when = "0.16.0", + what = "convert_output(file)", + details = "Please use `files` instead of `file`" + ) + + files <- file + } + if (lifecycle::is_present(model)) { + lifecycle::deprecate_warn( + when = "0.16.0", + what = "convert_output(model)", + details = "Please use `models` instead of `model`" + ) + + models <- model + } # Is user inputs a single model file and doesn't wrap it as a list object # First check handles WHAM and Rceattle models, second check handles single model input, # final check handles FIMS models diff --git a/man/convert_output.Rd b/man/convert_output.Rd index 6ba3e0f7..6d7c24b1 100644 --- a/man/convert_output.Rd +++ b/man/convert_output.Rd @@ -9,11 +9,13 @@ convert_output( models = NULL, fleet_names = NULL, save_dir = NULL, - start_year = NULL + start_year = NULL, + file = lifecycle::deprecated(), + model = lifecycle::deprecated() ) } \arguments{ -\item{files}{List of Paths. Assessment model output file paths. Currently accepts SS3 +\item{files}{List of paths. Assessment model output file paths. Currently accepts SS3 \code{r4ss::ss_output()} or Report.sso file (being deprecated), BAM .rda file, Rceattle model object, and FIMS output (the tibble returned by \code{FIMS::get_estimates()}, a \code{FIMSFit} object, or an .rds file with either). If multiple elements, all valid models will be read, converted, and @@ -21,7 +23,7 @@ appended together. \code{names(files)} will be used as the name of the model in the output.} -\item{models}{Character vector Assessment model used in evaluation +\item{models}{Character vector. Assessment model used in evaluation Default: NULL @@ -49,6 +51,14 @@ FIMS reports years as indices (1 = first model year), which are converted to years when \code{start_year} is given. Default: NULL (years are left as indices)} + +\item{file}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} +This argument was deprecated in favor of the \code{files} argument in order +to clarify that multiple files can be processed simultaneously.} + +\item{model}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} +This argument was deprecated in favor of the \code{models} argument in order +to clarify that multiple models can be processed simultaneously.} } \value{ A reformatted and standardized tibble of assessment model results