-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extracting numeric (key) quantities #29
base: master
Are you sure you want to change the base?
Conversation
…iomass and landings plots
…ecruitment, recruitment devs, spawning recruitment, and spawning biomass plots
…tment names to sr
1dd6a51
to
6b591d1
Compare
…iomass and landings plots
…ecruitment, recruitment devs, spawning recruitment, and spawning biomass plots
…tment names to sr
…o key-quantities
-replaced placeholder quantities with real values -updated workflow to improve how quantities are inserted into caps/alt text df -updated file.path() --> fs:::path()
…d .Rd files -included replacing export_rda param with make_rda param
…caption/alt text to figure
-removed Fend and added R0 as vars -removed old notes/code
removed make_rda param from exp_all_figs_tables.R
…lative biomass & relative spawning biomass caption/alt text to figures
… whole number -added quantites incl. Btarg, ssbtarg, and relative B, relative SSB, and relative recruitment max and mins -updated alt text/caps csv with relative quantities
Change plot_biomass and spawning_biomass plots to work through errors from reference line
R/write_captions.R
Outdated
## relative B | ||
# relative B min | ||
rel_B_min <- (B_min / Btarg) |> | ||
round(digits = 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed my mind - can we round to 2 digits with the exception of abundance since those are in terms of number of fish
# start year of ssb plot | ||
ssb_start_year <- dat |> | ||
dplyr::filter( | ||
label == "spawning_biomass", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this work for all examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works for two of my example dat files. Is it failing with yours? Or are there specific files that I should make sure to test it with?
# 'catchability_fleet' = catchability_fleet | ||
) | ||
|
||
caps_alttext_subbed <- caps_alttext |> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a note explaining what this pipeline is doing? I also haven't see the ", ~{" notation before in the below line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, added the note. The internet helped me with chunk, so here's what I believe is going on: the ~ is present because an anonymous function is passed to another function (dplyr::mutate). The { is separating the for loop from the output of the for loop, which is acted upon by dplyr::mutate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. I left a couple comments
…iomass and landings plots
…ecruitment, recruitment devs, spawning recruitment, and spawning biomass plots
…tment names to sr
-replaced placeholder quantities with real values -updated workflow to improve how quantities are inserted into caps/alt text df -updated file.path() --> fs:::path()
…d .Rd files -included replacing export_rda param with make_rda param
…caption/alt text to figure
-removed Fend and added R0 as vars -removed old notes/code
…lative biomass & relative spawning biomass caption/alt text to figures
… whole number -added quantites incl. Btarg, ssbtarg, and relative B, relative SSB, and relative recruitment max and mins -updated alt text/caps csv with relative quantities
…o key-quantities
@@ -53,6 +52,8 @@ exp_all_figs_tables <- function( | |||
|
|||
) { | |||
|
|||
make_rda = TRUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you take this out of the arguments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because if the user is using this function (to export all figs/tables), that implies that all figures and tables will be exported as rda files. So, make_rda would always be true.
-change rounding to 2 digits -add comment describing how caps_alttext_subbed is created
… underscores being recognized as special characters in latex script
Wrote code to extract numeric quantities for values associated with biomass and landings plots