Skip to content
527 changes: 527 additions & 0 deletions R/conout_bam.R

Large diffs are not rendered by default.

493 changes: 493 additions & 0 deletions R/conout_rceattle.R

Large diffs are not rendered by default.

1,273 changes: 1,273 additions & 0 deletions R/conout_ss3.R

Large diffs are not rendered by default.

2,303 changes: 22 additions & 2,281 deletions R/convert_output.R

Large diffs are not rendered by default.

177 changes: 176 additions & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' Included data set that represents a Report.sso file converted using
#' convert_output(). This example is from the 2022 Petrale sole stock assessment.
#'
#' @format A tibble with 591109 rows and 33 variables:
#' @format A tibble (\code{tbl_df}, \code{tbl}, \code{data.frame}) with 591109 rows and 33 variables:
#' \describe{
#' \item{label}{Standard name for estimate or value name}
#' \item{estimate}{Actual value of the label}
Expand Down Expand Up @@ -41,3 +41,178 @@
#' }
#'
"example_data"

#' 2018 Gulf of Alaska Pollock stock assessment output
#'
#' Standardized output of the 2018 Gulf of Alaska Pollock stock assessment
#' produced from Rceattle including all of the values needed to create
#' plots and tables in {stockplotr}. The example can be found and run from the
#' Rceattle repository.
#'
#' @docType data
#'
#' @usage data(pollock)
#'
#' @format A tibble (\code{tbl_df}, \code{tbl}, \code{data.frame}) with 9,983 rows and 35 variables:
#' \describe{
#' \item{label}{Standard name for estimate or value name}
#' \item{estimate}{Actual value of the label}
#' \item{year}{Annual indexing value}
#' \item{fleet}{Names of fleets or surveys indexed by the data}
#' \item{sex}{Native reference to male, female, unknown, or none}
#' \item{area}{Specified areas by the model}
#' \item{growth_pattern}{Indexing column of data}
#' \item{uncertainty}{Value of uncertainty associated with the label column}
#' \item{uncertainty_label}{Uncertainty label or name associated with the label columns}
#' \item{module_name}{Name of keyword (SS3) or list indexing in the original model output for tracking purposes}
#' \item{time}{Time sometimes referenced in decimals to the year and month}
#' \item{era}{"time" for current time series in model; "fore" representing the projected or forecasted years of the model}
#' \item{month}{Month factor}
#' \item{season}{Season usually associated with year}
#' \item{subseason}{Subseason when used}
#' \item{birthseas}{Birthseason found in SS3}
#' \item{initial}{Initial input value in the model when available associated with the label column}
#' \item{likelihood}{Likelihood value for the data point}
#' \item{platoon}{Platoon also an SS3 indexing value}
#' \item{age}{Age of fish}
#' \item{bio_pattern}{Indexing column of data}
#' \item{settlement}{Indexing column of data}
#' \item{morph}{Indexing column of data}
#' \item{type}{Indexing column of data}
#' \item{factor}{Indexing column of data}
#' \item{part}{Indexing column of data}
#' \item{kind}{Indexing column of data}
#' \item{nsim}{Indexing column of data}
#' \item{bin}{Indexing column of data}
#' \item{age_a}{Alternative age column}
#' \item{length_bins}{Length bins for composition or other length based data}
#' \item{count}{Indexing column of data}
#' \item{block}{Indexing column of data}
#' }
#'
#' @keywords datasets
#'
#' @references Adams, G. D., Holsman, K. K., Barbeaux, S. J., Dorn, M. W., Ianelli, J. N., Spies, I., … Punt, A. E. (2022)
#' (\href{https://doi.org/10.1016/j.fishres.2022.106303})
#'
#' @source \href{https://github.com/afsc-assessments/Rceattle/blob/main/examples/Fit_2018_GOA_single-species_models.R}{Rceattle Example}
#'
#' @examples
#' data(pollock)
#' head(pollock)
#' unique(pollock$label)
"pollock"

#' SEDAR 55 South Atlantic Vermilion Snapper
#'
#' Standardized output of the 2018 South Atlantic Vermilion Snapper stock assessment
#' produced from the Beaufort Assessment Model (BAM).
#'
#' @docType data
#'
#' @usage data(vermilion_snapper)
#'
#' @format A tibble (\code{tbl_df}, \code{tbl}, \code{data.frame}) with 35,881 rows and 35 variables:
#' \describe{
#' \item{label}{Standard name for estimate or value name}
#' \item{estimate}{Actual value of the label}
#' \item{year}{Annual indexing value}
#' \item{fleet}{Names of fleets or surveys indexed by the data}
#' \item{sex}{Native reference to male, female, unknown, or none}
#' \item{area}{Specified areas by the model}
#' \item{growth_pattern}{Indexing column of data}
#' \item{uncertainty}{Value of uncertainty associated with the label column}
#' \item{uncertainty_label}{Uncertainty label or name associated with the label columns}
#' \item{module_name}{Name of keyword (SS3) or list indexing in the original model output for tracking purposes}
#' \item{time}{Time sometimes referenced in decimals to the year and month}
#' \item{era}{"time" for current time series in model; "fore" representing the projected or forecasted years of the model}
#' \item{month}{Month factor}
#' \item{season}{Season usually associated with year}
#' \item{subseason}{Subseason when used}
#' \item{birthseas}{Birthseason found in SS3}
#' \item{initial}{Initial input value in the model when available associated with the label column}
#' \item{likelihood}{Likelihood value for the data point}
#' \item{platoon}{Platoon also an SS3 indexing value}
#' \item{age}{Age of fish}
#' \item{bio_pattern}{Indexing column of data}
#' \item{settlement}{Indexing column of data}
#' \item{morph}{Indexing column of data}
#' \item{type}{Indexing column of data}
#' \item{factor}{Indexing column of data}
#' \item{part}{Indexing column of data}
#' \item{kind}{Indexing column of data}
#' \item{nsim}{Indexing column of data}
#' \item{bin}{Indexing column of data}
#' \item{age_a}{Alternative age column}
#' \item{length_bins}{Length bins for composition or other length based data}
#' \item{count}{Indexing column of data}
#' \item{block}{Indexing column of data}
#' }
#'
#' @keywords datasets
#'
#' @references SEDAR (2018)
#' (\href{https://sedarweb.org/documents/sedar-55-stock-assessment-report-south-atlantic-vermilion-snapper/})
#'
#' @examples
#' data(vermilion_snapper)
#' head(vermilion_snapper)
#' unique(vermilion_snapper$label)
"vermilion_snapper"

#' SS3 Simple stock assessment output
#'
#' Standardized output of a generic simple example of SS3 found from the `r4ss`
#' repository examples. The raw output is converted to an R readable object
#' using `r4ss::ss_output` then standardized using `stockplotr::convert_output()`.
#'
#' @docType data
#'
#' @usage data(ss3_simple)
#'
#' @format A tibble (\code{tbl_df}, \code{tbl}, \code{data.frame}) with 38,195 rows and 35 variables:
#' \describe{
#' \item{label}{Standard name for estimate or value name}
#' \item{estimate}{Actual value of the label}
#' \item{year}{Annual indexing value}
#' \item{fleet}{Names of fleets or surveys indexed by the data}
#' \item{sex}{Native reference to male, female, unknown, or none}
#' \item{area}{Specified areas by the model}
#' \item{growth_pattern}{Indexing column of data}
#' \item{uncertainty}{Value of uncertainty associated with the label column}
#' \item{uncertainty_label}{Uncertainty label or name associated with the label columns}
#' \item{module_name}{Name of keyword (SS3) or list indexing in the original model output for tracking purposes}
#' \item{time}{Time sometimes referenced in decimals to the year and month}
#' \item{era}{"time" for current time series in model; "fore" representing the projected or forecasted years of the model}
#' \item{month}{Month factor}
#' \item{season}{Season usually associated with year}
#' \item{subseason}{Subseason when used}
#' \item{birthseas}{Birthseason found in SS3}
#' \item{initial}{Initial input value in the model when available associated with the label column}
#' \item{likelihood}{Likelihood value for the data point}
#' \item{platoon}{Platoon also an SS3 indexing value}
#' \item{age}{Age of fish}
#' \item{bio_pattern}{Indexing column of data}
#' \item{settlement}{Indexing column of data}
#' \item{morph}{Indexing column of data}
#' \item{type}{Indexing column of data}
#' \item{factor}{Indexing column of data}
#' \item{part}{Indexing column of data}
#' \item{kind}{Indexing column of data}
#' \item{nsim}{Indexing column of data}
#' \item{bin}{Indexing column of data}
#' \item{age_a}{Alternative age column}
#' \item{length_bins}{Length bins for composition or other length based data}
#' \item{count}{Indexing column of data}
#' \item{block}{Indexing column of data}
#' }
#'
#' @keywords datasets
#'
#' @source \href{https://github.com/r4ss/r4ss/}{r4ss Repository}
#'
#' @examples
#' data(ss3_simple)
#' head(ss3_simple)
#' unique(ss3_simple$label)
"ss3_simple"
10 changes: 6 additions & 4 deletions data-raw/DATASET_BAM.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
## code to prepare `VermilionSnapper` dataset goes here
## code to prepare `vermilion_snapper` dataset goes here
# Path to SS3 output file
EX_REPORT_PATH <- file.path("inst", "extdata", "VermilionSnapper.rdat")
# Install stockplotr
pak::local_install(".")
# Convert output
VermilionSnapper <- stockplotr::convert_output(EX_REPORT_PATH)
VermilionSnapper <- subset(VermilionSnapper, year > 1980)
vermilion_snapper <- stockplotr::convert_output(EX_REPORT_PATH)
vermilion_snapper <- subset(vermilion_snapper, year > 1980)
# Save object as rda into raw_data
usethis::use_data(VermilionSnapper, overwrite = TRUE)
usethis::use_data(vermilion_snapper, overwrite = TRUE)
# Overwrite as compressed data
save(vermilion_snapper, file = "data/vermilion_snapper.rda", compress = "xz", compression_level = 9)
6 changes: 4 additions & 2 deletions data-raw/DATASET_RCEATTLE.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ install.packages(c("remotes")) # , "readxl"
remotes::install_github("afsc-assessments/Rceattle")
# library(Rceattle)
# library(readxl)
Rceattle::data("GOApollock")
data("GOApollock")
GOApollock$styr = 1977 # The SAFE model starts at 1970, so change styr to 1970 to run the full time series model (data is in there). I start them all at 1977 because thats the years with overlap.
pollock_model <- Rceattle::fit_mod(
data_list = GOApollock,
Expand All @@ -20,5 +20,7 @@ pak::local_install(".")
# Convert output
# OK not to subset bc small
pollock <- stockplotr::convert_output(pollock_model)
# Save object as rda into raw_data
# Save object as rda into raw_data -- and document
usethis::use_data(pollock, overwrite = TRUE)
# Overwrite compressed version
save(pollock, file = "data/pollock.rda", compress = "xz", compression_level = 9)
Binary file removed data/VermilionSnapper.rda
Binary file not shown.
Binary file modified data/pollock.rda
Binary file not shown.
Binary file added data/vermilion_snapper.rda
Binary file not shown.
25 changes: 25 additions & 0 deletions man/conout_bam.Rd

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

25 changes: 25 additions & 0 deletions man/conout_rceattle.Rd

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

26 changes: 26 additions & 0 deletions man/conout_ss3.Rd

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

2 changes: 1 addition & 1 deletion man/example_data.Rd

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

66 changes: 66 additions & 0 deletions man/pollock.Rd

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

Loading
Loading