Skip to content
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

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open

Conversation

sbreitbart-NOAA
Copy link
Collaborator

Wrote code to extract numeric quantities for values associated with biomass and landings plots

…ecruitment, recruitment devs, spawning recruitment, and spawning biomass plots
-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
@sbreitbart-NOAA sbreitbart-NOAA marked this pull request as ready for review December 10, 2024 20:21
Schiano-NOAA and others added 8 commits December 11, 2024 16:05
-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
## relative B
# relative B min
rel_B_min <- (B_min / Btarg) |>
round(digits = 0)
Copy link
Collaborator

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",
Copy link
Collaborator

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?

Copy link
Collaborator Author

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 |>
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator

@Schiano-NOAA Schiano-NOAA left a 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

sbreitbart-NOAA and others added 13 commits December 17, 2024 13:45
…ecruitment, recruitment devs, spawning recruitment, and spawning biomass plots
-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
-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
@@ -53,6 +52,8 @@ exp_all_figs_tables <- function(

) {

make_rda = TRUE
Copy link
Collaborator

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?

Copy link
Collaborator Author

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants