From 627e7bfe04dbc49e8d7dfd876e54e0184cfb0ad2 Mon Sep 17 00:00:00 2001 From: Sam Schiano <125507018+Schiano-NOAA@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:14:30 -0500 Subject: [PATCH 1/6] add new section for naming --- vignettes/convert_output_details.Rmd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vignettes/convert_output_details.Rmd b/vignettes/convert_output_details.Rmd index dd3b10f2..09b2678e 100644 --- a/vignettes/convert_output_details.Rmd +++ b/vignettes/convert_output_details.Rmd @@ -156,6 +156,12 @@ The final data frame does not manipulate column typing (character, numeric, etc. In conclusion, the final data frame should be very long with repeating years and factors to represent each point of data from the output file. Some metrics such as estimated stock-recruitment curve, weight-length relationship or other similar parameters are not currently in this function. There are also a number of "keywords" found in the SS3 Report.sso file that are not in the converted output file. We plan to update this in the future, but we prioritized the converter to contain information for plotting. +## Standard naming in Functions + + + +- + ## Helpful Functions to Manipulate Data The following functions were used in the [`convert_output()`](https://github.com/nmfs-ost/stockplotr/blob/main/R/convert_output.R) function that could be helpful for users replicating it for other assessment models: From 30c19994c0bb4c029ae7a3f88915f059c09551bf Mon Sep 17 00:00:00 2001 From: Sam Schiano <125507018+Schiano-NOAA@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:55:28 -0500 Subject: [PATCH 2/6] add names from abundance aa through discard plots --- vignettes/convert_output_details.Rmd | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/vignettes/convert_output_details.Rmd b/vignettes/convert_output_details.Rmd index 09b2678e..a3e89142 100644 --- a/vignettes/convert_output_details.Rmd +++ b/vignettes/convert_output_details.Rmd @@ -160,7 +160,23 @@ In conclusion, the final data frame should be very long with repeating years and -- +- `plot_abundance_at_age` = "abundance" +- `plot_age_to_length_conversion` = "age_to_length_conversion" +- `plot_biomass_at_age` = "biomass" +- `plot_biomass` = "biomass_biomass_unfished|biomass_ratio", "^biomass$" -- depends on wanting relative values +- `plot_catch_at_age` = "catch|landings" (whatever variation of this is available -- typically only one because we are looking at only catch with age) +- `plot_composition`/`plot_composition_diagnostics` = +[1] "length_composition_observed" +[2] "length_composition_predicted" +[3] "length_composition_pearson_residual" +[4] "length_composition_sample_size" +[5] "age_composition_observed" +[6] "age_composition_predicted" +[7] "age_composition_pearson_residual" +[8] "age_composition_sample_size" +- `plot_data_availability` = see function data_availability in the file plot_data_availability.R +- `plot_discard` = "^discard" -- fits are ^discard_(observed|predicted)$" + ## Helpful Functions to Manipulate Data From a56ded19d83e561add4eb210d59dbf5098d2dd5f Mon Sep 17 00:00:00 2001 From: sbreitbart-NOAA Date: Wed, 2 Dec 2026 14:57:47 -0500 Subject: [PATCH 3/6] add standard names for latter third of functions --- R/plot_recruitment.R | 2 +- vignettes/convert_output_details.Rmd | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/R/plot_recruitment.R b/R/plot_recruitment.R index a4be6280..19aa6149 100644 --- a/R/plot_recruitment.R +++ b/R/plot_recruitment.R @@ -51,7 +51,7 @@ plot_recruitment <- function( # Extract recruitment prepared_data <- filter_data( dat = dat, - label_name = "recruitment$", # might need to adjust for expected vs predicted rec + label_name = "recruitment$", geom = "line", era = era, group = group, diff --git a/vignettes/convert_output_details.Rmd b/vignettes/convert_output_details.Rmd index a3e89142..cfdbb2fb 100644 --- a/vignettes/convert_output_details.Rmd +++ b/vignettes/convert_output_details.Rmd @@ -176,7 +176,14 @@ In conclusion, the final data frame should be very long with repeating years and [8] "age_composition_sample_size" - `plot_data_availability` = see function data_availability in the file plot_data_availability.R - `plot_discard` = "^discard" -- fits are ^discard_(observed|predicted)$" - +- `plot_spawning_biomass()`: "spawning_biomass_spawning_biomass_{ref_line}", "spawning_biomass_ratio", "^spawning_biomass$" +- `plot_spr()`: "spr" +- `plot_stock_recruitment()`: "recruitment" +- `table_biomass_abundance_catch()`: "^biomass\$", "^abundance", "catch$", "landings_observed" +- `table_index()`: "index_observed", "index_predicted" +- `table_landings()`: "landings_observed", "landings_observed_weight", "landings_observed_numbers", "catch_predicted", "catch" +- `table_projections()`: "^catch\$", "^landings_weight\$", "^spawning_biomass\$", "^fishing_mortality\$" +- `table_total_catch()`: "^catch" ## Helpful Functions to Manipulate Data From f4e3113e03175a1220d54d3a100f302064592f07 Mon Sep 17 00:00:00 2001 From: Amanda Hart <144831749+amanda-hart@users.noreply.github.com> Date: Thu, 3 Dec 2026 10:51:15 -0500 Subject: [PATCH 4/6] Fxn std names (#545) * Document standard naming for plot_fishing_mortality - plot_selectivity functions. * Restore original indentation for lists. * Restore original indentation for lists. --------- Co-authored-by: Sam (Schiano) Bredeck <125507018+Schiano-NOAA@users.noreply.github.com> --- vignettes/convert_output_details.Rmd | 29 ++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/vignettes/convert_output_details.Rmd b/vignettes/convert_output_details.Rmd index cfdbb2fb..fddfca3e 100644 --- a/vignettes/convert_output_details.Rmd +++ b/vignettes/convert_output_details.Rmd @@ -46,14 +46,12 @@ The converter manipulates data sets by recognizing patterns based on the assessm The data is manipulated to follow the format in @tbl-cols. The majority of the code in the function is specific for how one would manipulate the output with the following exceptions. The code in the converter creates an empty data frame with the columns referenced in @tbl-cols (See [code](https://github.com/nmfs-ost/stockplotr/blob/c8db61f325e9926461c70ef2d62349eb8d2bf2dd/R/convert_output.R#L45-L81)). At the end of the function, standard naming conventions are applied to rename labels of parameters or quantities as followed in @sec-namecon. Currently, we have files to use as examples to change the names of labels following our convention. One of the example files can be downloaded [here](https://github.com/nmfs-ost/stockplotr/blob/main/inst/resources/ss3_var_names.xlsx). The final data frame is exported to the user's environment as an object, if it is assigned an object name (e.g., `my_converted_output <- convert_output(...)`). - ```{r, echo=TRUE} #| eval: false load("example_conout.rda") head(hake_conout) ``` - The data frame is structured in following the convention of FIMS but removing the use of S4 or S3 data frame classes encouraging a more user friendly set up to start. The following format outlines the standard data frame: | Column label | Description | @@ -160,12 +158,13 @@ In conclusion, the final data frame should be very long with repeating years and -- `plot_abundance_at_age` = "abundance" -- `plot_age_to_length_conversion` = "age_to_length_conversion" -- `plot_biomass_at_age` = "biomass" -- `plot_biomass` = "biomass_biomass_unfished|biomass_ratio", "^biomass$" -- depends on wanting relative values -- `plot_catch_at_age` = "catch|landings" (whatever variation of this is available -- typically only one because we are looking at only catch with age) -- `plot_composition`/`plot_composition_diagnostics` = + +- `plot_abundance_at_age()` : "abundance" +- `plot_age_to_length_conversion()` : "age_to_length_conversion" +- `plot_biomass_at_age()` : "biomass" +- `plot_biomass()` : "biomass_biomass_unfished|biomass_ratio", "^biomass$" -- depends on wanting relative values +- `plot_catch_at_age()` : "catch|landings" (whatever variation of this is available -- typically only one because we are looking at only catch with age) +- `plot_composition()`/`plot_composition_diagnostics()` : [1] "length_composition_observed" [2] "length_composition_predicted" [3] "length_composition_pearson_residual" @@ -174,8 +173,18 @@ In conclusion, the final data frame should be very long with repeating years and [6] "age_composition_predicted" [7] "age_composition_pearson_residual" [8] "age_composition_sample_size" -- `plot_data_availability` = see function data_availability in the file plot_data_availability.R -- `plot_discard` = "^discard" -- fits are ^discard_(observed|predicted)$" +- `plot_data_availability()` : see function data_availability in the file plot_data_availability.R +- `plot_discard()` : "^discard" -- fits are ^discard_(observed|predicted)$" +- `plot_fishing_mortality()` : "\^fishing_mortality\$" +- `plot_index()` : "\^index\_(observed\|predicted)\$" +- `plot_joint_residuals()` : "\^index\_(observed\|predicted)\$" +- `plot_landings()` : "catch", "catch_predicted", "landings_observed", "landings_observed_weight", "landings_observed_numbers", "catch_predicted", "landings" +- `plot_natural_mortality()` : "natural_mortality" +- `plot_recruitment_deviations()` : "recruitment_deviations" +- `plot_recruitment()` : "recruitment\$", "predicted_recruitment", "expected_recruitment" +- `plot_retrospective()` : Inherits naming from plot_biomass(), plot_spawning_biomass(), plot_fishing_mortality(), plot_recruitment(), or plot_spr() +- `plot_runs_test()` : "\^index\_(observed\|predicted)\$" +- `plot_selectivity()` : "selectivity" - `plot_spawning_biomass()`: "spawning_biomass_spawning_biomass_{ref_line}", "spawning_biomass_ratio", "^spawning_biomass$" - `plot_spr()`: "spr" - `plot_stock_recruitment()`: "recruitment" From 4bc8e2d667e84fd0c6e2284043c2909a53fe6527 Mon Sep 17 00:00:00 2001 From: Sam Schiano <125507018+Schiano-NOAA@users.noreply.github.com> Date: Thu, 3 Dec 2026 10:52:49 -0500 Subject: [PATCH 5/6] update WORDLIST --- inst/WORDLIST | 64 +++++++++++---------------------------------------- 1 file changed, 13 insertions(+), 51 deletions(-) diff --git a/inst/WORDLIST b/inst/WORDLIST index ee011d55..43ca0df3 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,23 +1,32 @@ BAM BMSY Barbeaux +Beringraja Birthseason +Bizzarro CPUE Carvalho Dorn +EffN FIMS FLIMIT FMSY FTARGET Fmort +GenSI +Gertseva Hennen Holsman Ianelli +Jeffreys Lifecycle MSY +McAllister Modelling +Mohn's NOAA ORCID +OST Petrale Pre Preformatted @@ -25,31 +34,24 @@ Rceattle Rda Rmarkdown Rmd +SDNR SEDAR SPR Spawners StockSmart Subseason -aa -agedbase +WCGBTS +Wolfowitz al alttext asar assmt -BAM bam -Beringraja -bigskate binoculata birthseas -Birthseason -Bizzarro -BMSY -caal cha cmd conjuction -CPUE csv customizations cv @@ -57,84 +59,46 @@ dat dataframe's diagonostic dplyr -EffN et facetting -FIMS fims flextable -FLIMIT -Fmort -FMSY -FTARGET -GenSI -Gertseva getwd ggplot gp -Hennen hline href -Ianelli is’ -Jeffreys kableExtra kobe len -lencomp -lendbase -Lifecycle loess -McAllister -Mohn's -mohn's mis -Modelling -MSY misspecification msy natively -NOAA noaa -Nsamp nsim -obsvpred -ORCID -OST pearson -Petrale pkgdown -Pre -Preformatted preformatted preselected qq -Rceattle rceattle -Rda rda -rds rda's rdat -Rmarkdown -Rmd +rds rowid satf sd -SDNR se seealso socio -Spawners -SPR ss -SSMethod sso -stddev -StockSmart str stringr -Subseason subseason tbl theming @@ -144,7 +108,5 @@ tibbles tidyr tidyselect unfished -WCGBTS -Wolfowitz yaml yml From da1c40d5d8784b4e9a398f90ebfd8ea40e7387cf Mon Sep 17 00:00:00 2001 From: Sam Schiano <125507018+Schiano-NOAA@users.noreply.github.com> Date: Thu, 3 Dec 2026 10:57:14 -0500 Subject: [PATCH 6/6] add description before names --- inst/WORDLIST | 1 + vignettes/convert_output_details.Rmd | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/WORDLIST b/inst/WORDLIST index 43ca0df3..9cef7441 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -95,6 +95,7 @@ sd se seealso socio +spr ss sso str diff --git a/vignettes/convert_output_details.Rmd b/vignettes/convert_output_details.Rmd index fddfca3e..e5723546 100644 --- a/vignettes/convert_output_details.Rmd +++ b/vignettes/convert_output_details.Rmd @@ -156,8 +156,7 @@ In conclusion, the final data frame should be very long with repeating years and ## Standard naming in Functions - - +The following is a list of standard naming conventions used in the functions within the {stockplotr} package. These names correspond to the labels being searched for in the standard data format that each plotting function expects from the converted output data frame. Many of these strings are regular expressions meaning if they begin with "^", they are searching for the start of the string. If they end with "$", they are searching for the end of the string. If the string starts with "^" and ends with "$", it is searching for an exact match of the entire string. For exact names, please refer to any of the example output "label" columns found in the package (vermilion_snapper, ss3_simple, or cod). - `plot_abundance_at_age()` : "abundance" - `plot_age_to_length_conversion()` : "age_to_length_conversion"