Repository navigation
[Feat]: age-to-length conversion plot - #512
MOshima-PIFSC wants to merge 17 commits into
Conversation
Co-authored-by: Sam (Schiano) Bredeck <Schiano-NOAA@users.noreply.github.com>
* add age length key into conout for ss3 * fix issue with ALK in r4ss * update example data
Co-authored-by: Sam (Schiano) Bredeck <Schiano-NOAA@users.noreply.github.com>
Co-authored-by: Sam (Schiano) Bredeck <Schiano-NOAA@users.noreply.github.com>
Co-authored-by: Ian Taylor <iantaylor-NOAA@users.noreply.github.com> Co-authored-by: Sam (Schiano) Bredeck <Schiano-NOAA@users.noreply.github.com>
…ered by ef0c8d7 add make RDA section. Make alt text dynamic.) [skip ci]
Code Metrics Report
Code coverage of files in pull request scope (77.9%, patch 30.0%)
Reported by octocov |
|
Note for @sbreitbart-NOAA : we incorporated a new approach that looks over and describes trends of each facet (up to 2 facets) that is replacing a placeholder in the alt text. This was because the way these plots get described is easy to automate comparatively to other trends you see on other plots like |
|
@MOshima-PIFSC and @Schiano-NOAA, I mentioned yesterday that the one SS3 production assessment that I knew of which has more than 2 growth morphs is the Gulf of Alaska Rex Sole assessment developed by @careymcgilliard. The plot below is the result of running the following code to read the input files, run the model, and make the plot. The alt-text looks reasonable to me:
For others watching this, we discussed in our meeting yesterday that repeating the summary of the pattern in each panel for more than 2 panels in this plot could make for really long alt-text not necessarily make better alt-text and would only apply to a tiny fraction of models. # define a directory (change as needed)
goa_rex_dir <- file.path(getwd(), "goa_rex")
# load input files from github
goa_rex_inputs <- r4ss::SS_read("https://raw.githubusercontent.com/noaa-afsc/goa_rex/refs/heads/main/runs/2025_models/2021_accepted_model_inputs/")
# save files to local directory
r4ss::SS_write(goa_rex_inputs, dir = goa_rex_dir)
# get SS3 exe if needed
r4ss::get_ss3_exe(dir = goa_rex_dir)
# run model without Hessian (no uncertainty needed for growth plot)
r4ss::run(goa_rex_dir, extras = "-nohess")
# load model output
goa_rex_out <- r4ss::SS_output(goa_rex_dir)
# convert output to stockplotr standard format
goa_rex_std <- stockplotr::convert_output(goa_rex_out)
stockplotr::plot_age_to_length_conversion(goa_rex_std) +
ggplot2::theme_minimal() # works better with Ian's github dark mode setting
ggsave(file.path(goa_rex_dir, "age_to_length.png"), width = 7, height = 7)
|
|
Thanks @iantaylor-NOAA for testing that! Looks like its working how we wanted it to :) |

What is the feature?
How have you implemented the solution?
plot_age_to_length()andplot_density()Does the PR impact any other area of the project, maybe another repo?
I'm not sure if this is fully ready to be merged in so I am making it a draft for now.
PR contribution checklist
Thank you for contributing to stockplotr! Please check the boxes below to confirm this pull request (PR) is ready for review. Edit this PR description to add the release indicator and any explanations.