Skip to content

Commit

Permalink
removed "div" from Kobe plot object names; shortened est stock recrui…
Browse files Browse the repository at this point in the history
…tment names to sr
  • Loading branch information
sbreitbart-NOAA committed Dec 2, 2024
1 parent c429faa commit 6b591d1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions R/write_captions.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ write_captions <- function(dat, # converted model output object
# FIGURES-----

## kobe plot
# B_div_BMSY_min <- # minimum value of B/B(MSY)
# B_div_BMSY_max <- # maximum value of B/B(MSY)
# F_div_FMSY_min <- # minimum value of F/F(MSY)
# F_div_FMSY_max <- # maximum value of F/F(MSY)
# B_div_BMSY_end_yr <- # value of B/B(MSY) at the end year
# F_div_FMSY_end_yr <- # value of F/F(MSY) at the end year
# B_BMSY_min <- # minimum value of B/B(MSY)
# B_BMSY_max <- # maximum value of B/B(MSY)
# F_FMSY_min <- # minimum value of F/F(MSY)
# F_FMSY_max <- # maximum value of F/F(MSY)
# B_BMSY_end_yr <- # value of B/B(MSY) at the end year
# F_FMSY_end_yr <- # value of F/F(MSY) at the end year
# overfished_status_is_isnot <- # object that should be "is" or "is not" and answers the question, "the stock overfishing status ___ overfished"
# overfishing_status_is_isnot <- # object that should be "is" or "is not" and answers the question, "the stock ___ experiencing overfishing"
# kobe_start_year <- # start year of kobe plot
Expand Down Expand Up @@ -268,14 +268,14 @@ write_captions <- function(dat, # converted model output object

## estimated stock recruitment (aka spawning stock biomass)
# youngest-age recruited fish (instead of age-0)
# est_stock_recruitment_age_min <- # unsure how to extract this
# sr_age_min <- # unsure how to extract this

# ssb units (plural)
# est_stock_recruitment_ssb_units <- # this will take some thought, since
# sr_ssb_units <- # this will take some thought, since
# spawning_biomass_label is entered by the user in plot_spawn_recruitment.R

# minimum ssb
est_stock_recruitment_ssb_min <- dat |>
sr_ssb_min <- dat |>
dplyr::filter(label == "spawning_biomass",
module_name == "TIME_SERIES" | module_name == "t.series",
!is.na(year),
Expand All @@ -292,7 +292,7 @@ write_captions <- function(dat, # converted model output object
as.numeric()

# maximum ssb
est_stock_recruitment_ssb_max <- dat |>
sr_ssb_max <- dat |>
dplyr::filter(label == "spawning_biomass",
module_name == "TIME_SERIES" | module_name == "t.series",
!is.na(year),
Expand All @@ -309,11 +309,11 @@ write_captions <- function(dat, # converted model output object
as.numeric()

# recruitment units (plural)
# est_stock_recruitment_units <- # this will take some thought, since recruitment_label
# sr_units <- # this will take some thought, since recruitment_label
# is entered by the user in plot_spawn_recruitment.R

# minimum recruitment
est_stock_recruitment_min <- dat |>
sr_min <- dat |>
dplyr::filter(label == "recruitment",
module_name == "TIME_SERIES" | module_name == "t.series",
!is.na(year),
Expand All @@ -330,7 +330,7 @@ write_captions <- function(dat, # converted model output object
as.numeric()

# maximum recruitment
est_stock_recruitment_max <- dat |>
sr_max <- dat |>
dplyr::filter(label == "recruitment",
module_name == "TIME_SERIES" | module_name == "t.series",
!is.na(year),
Expand Down Expand Up @@ -374,10 +374,10 @@ write_captions <- function(dat, # converted model output object
# either entered by the user or calculated in plot_recruitment.R

# minimum recruitment
recruitment_min <- est_stock_recruitment_min
recruitment_min <- sr_min

# maximum recruitment
recruitment_max <- est_stock_recruitment_max
recruitment_max <- sr_max


## recruitment deviations
Expand Down
4 changes: 2 additions & 2 deletions inst/resources/captions_alt_text_template.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
label,type,caption,alt_text
kobe,figure,"Kobe plot showing stock status. Triangles delineate start and end years. Horizontal and vertical dashed lines delineate reference points for overfishing (i.e., F/F~MSY~>1) and overfished status (i.e., B/B~MSY~ <1) where MSY represents either actual maximum sustainable yield or a proxy for MSY.","A Kobe plot showing stock status from kobe_start_year to kobe_end_year. The x axis, showing overfished status (i.e., B/B~MSY~), spans from B_div_BMSY_min to B_div_BMSY_max and the y axis, showing overfishing (i.e., F/F~MSY~), spans from F_div_FMSY_min to F_div_FMSY_max. The B/B~MSY~ and F/F~MSY~ for end_year_kobe were B_div_BMSY_end_yr and F_div_FMSY_end_yr, respectively, indicating that the stock overfished_status_is_isnot overfished and overfishing_status_is_is_not experiencing overfishing."
kobe,figure,"Kobe plot showing stock status. Triangles delineate start and end years. Horizontal and vertical dashed lines delineate reference points for overfishing (i.e., F/F~MSY~>1) and overfished status (i.e., B/B~MSY~ <1) where MSY represents either actual maximum sustainable yield or a proxy for MSY.","A Kobe plot showing stock status from kobe_start_year to kobe_end_year. The x axis, showing overfished status (i.e., B/B~MSY~), spans from B_BMSY_min to B_BMSY_max and the y axis, showing overfishing (i.e., F/F~MSY~), spans from F_FMSY_min to F_FMSY_max. The B/B~MSY~ and F/F~MSY~ for end_year_kobe were B_BMSY_end_yr and F_FMSY_end_yr, respectively, indicating that the stock overfished_status_is_isnot overfished and overfishing_status_is_is_not experiencing overfishing."
biomass,figure,Biomass (B) time series. The horizontal dashed line represents the limit reference point (B_ref_pt B_ref_pt_unit).,"Line graph showing biomass time series. The x axis, showing the year, spans from B_start_year to B_end_year and the y axis, showing biomass in B_units, spans from B_min to B_max."
fishing_mortality,figure,Fishing mortality (F) over time. The horizontal dashed line represents the target reference point (F_ref_pt F_ref_pt_unit).,"Line graph showing fishing mortality over time . The x axis, showing the year, spans from F_start_year to F_end_year and the y axis, showing fishing mortality in F_units, spans from F_min to F_max."
landings,figure,Historical landings by fleet.,"Cumulative area plot showing historical landings. The x axis, showing the year, spans from landings_start_year to landings_end_year and the y axis, showing landings in landings_units, spans from landings_min to landings_max."
Expand All @@ -17,7 +17,7 @@ mod_fit_catch,figure,Observed catch from the data input file (points) and model
mod_fit_abun,figure,Assessment model fits to input catch per unit of effort index values over time calculated from fleet_or_survey_name.,"Point and line graph showing the assessment model fit, displayed as a line, to input catch per unit effort index values, displayed as points over time, for fleet_or_survey_name. The x axis, showing years, spans from mod_fit_abun_start_year to mod_fit_abun_end_year, and the y axis, showing catch per unit effort in cpue_units, spans from cpue_min to cpue_max."
mod_fit_discards,figure,Observed discards (points) and model-estimated discards (line).,"Point and line graph showing the assessment model fit to observed discards. Observed discards are represented as points while the model fitted estimates are represented as a line over time for fleet_or_survey_name. The x axis, showing the year, spans from mod_fit_discards_start_year to mod_fit_discards_end_year, and the y axis, showing discards in mod_fit_discards_units, spans from mod_fit_discards_min to mod_fit_discards_max."
selectivity,figure,Length-based selectivity for each fleet and survey estimated by the assessment model.,"Line graph showing length-based selectivity for fleet_or_survey_name from selectivity_start_year to selectivity_end_year. The x axis, showing length in selectivity_length_units, spans from selectivity_length_min to selectivity_length_max, and the y axis, showing the proportion of the stock that the gear selects for, spans from 0--1."
est_stock_recruitment,figure,Stock recruitment relationship estimated by the assessment model. ,"Point and line graph showing the relationship between spawning stock biomass and newly recruited est_stock_recruitment_age_min fish as estimated by the assessment model. Points represent model estimates of recruitment each year as a function of spawning stock biomass, after adjusted by annual recruitment deviations. The line represents the best fit through the points for the spawning stock relationship selected for use in the assessment model. The x axis, showing spawning stock biomass in est_stock_recruitment_ssb_units, spans from est_stock_recruitment_ssb_min to est_stock_recruitment_ssb_max, while the y axis, showing recruitment in est_stock_recruitment_units, spans from est_stock_recruitment_min to est_stock_recruitment_max."
sr,figure,Stock recruitment relationship estimated by the assessment model. ,"Point and line graph showing the relationship between spawning stock biomass and newly recruited sr_age_min fish as estimated by the assessment model. Points represent model estimates of recruitment each year as a function of spawning stock biomass, after adjusted by annual recruitment deviations. The line represents the best fit through the points for the spawning stock relationship selected for use in the assessment model. The x axis, showing spawning stock biomass in sr_ssb_units, spans from sr_ssb_min to sr_ssb_max, while the y axis, showing recruitment in sr_units, spans from sr_min to sr_max."
recruitment,figure,Estimated recruitment by the assessment model each year in recruitment_units.,"Line graph showing the assessment model estimated recruitment in unit for each year. The x axis, showing years, spans from recruitment_start_year to recruitment_end_year while the y axis, showing recruitment in recruitment_units, spans from recruitment_min to recruitment_max."
recruitment_deviations,figure,Annual deviations (on natural log scale) in the number of newly recruited fish the model estimates each year. ,"Scatterplot showing annual deviations in recruitment. Points have error bars and the dashed horizontal line at 0 represents no deviation from what would be estimated by the stock-recruit relationship. Positive values represent an increase in recruitment that year while negative values represent a decrease. The x axis, showing year, spans from recruit_dev_start_year to recruit_dev_end_year, while the y axis, showing the recruitment deviation, spans from recruit_dev_min to recruit_dev_max on a natural log scale."
tot_b,figure,Model-estimated biomass (B) time series. The horizontal dashed line represents the biomass limit reference point at biomass_ref_pt biomass_ref_pt_units.,"Line graph showing model-estimated biomass time series. The x axis, showing the year, spans from biomass_start_year to biomass_end_year, and the y axis, showing model-estimated biomass in biomass_units, spans from biomass_min to biomass_max."
Expand Down

0 comments on commit 6b591d1

Please sign in to comment.