Skip to content

Commit

Permalink
add dat arg to B, R, SSB plotting fxns, and add_more_key_quants, to a…
Browse files Browse the repository at this point in the history
…ddress failing tests
  • Loading branch information
sbreitbart-NOAA committed Feb 24, 2025
1 parent d669d13 commit 1fe2cc3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/plot_biomass.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ plot_biomass <- function(

# add more key quantities included as arguments in this fxn
add_more_key_quants(
dat,
topic = topic_label,
fig_or_table = fig_or_table,
dir = rda_dir,
Expand Down
1 change: 1 addition & 0 deletions R/plot_recruitment.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ plot_recruitment <- function(

# add more key quantities included as arguments in this fxn
add_more_key_quants(
dat,
topic = topic_label,
fig_or_table = fig_or_table,
dir = rda_dir,
Expand Down
1 change: 1 addition & 0 deletions R/plot_spawning_biomass.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ plot_spawning_biomass <- function(

# add more key quantities included as arguments in this fxn
add_more_key_quants(
dat,
topic = topic_label,
fig_or_table = fig_or_table,
dir = rda_dir,
Expand Down
8 changes: 8 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# substitute in more key quantities (units, end_years, reference points, and more)
# to captions/alt text
add_more_key_quants <- function(
dat = NULL,
topic = topic_label,
fig_or_table = fig_or_table,
dir = NULL,
Expand All @@ -28,6 +29,13 @@ add_more_key_quants <- function(
dplyr::filter(label == topic,
type == fig_or_table)

if (!is.null(dat)){
dat <- dat |>
dplyr::mutate(estimate = as.numeric(estimate),
year = as.numeric(year),
age = as.numeric(age))
}


# calculate key quantities that rely on end_year for calculation
## terminal fishing mortality
Expand Down

0 comments on commit 1fe2cc3

Please sign in to comment.