Skip to content

[Fix] plot_spawning_biomass when user wants to use DERIVED_QUANTITIES from SS3#222

Draft
Schiano-NOAA wants to merge 1 commit intodevfrom
fix-sb-plt-219
Draft

[Fix] plot_spawning_biomass when user wants to use DERIVED_QUANTITIES from SS3#222
Schiano-NOAA wants to merge 1 commit intodevfrom
fix-sb-plt-219

Conversation

@Schiano-NOAA
Copy link
Copy Markdown
Collaborator

Summary

An issue was identified in plot_spawning_biomass (and most likely our other plots) when wanting to access specific data. After some investigation, "DERIVED_QUANTITIES" is found in the converted dataset when era = NULL; however there was still an issue finishing the plot because era = NULL in the reference line results in an error. The issue was identified in #219

The fix:

  • adjust reference line to take our era and use plot data instead

Additional changes

  • took out a conditional section when era = NULL plotting horizontal break lines (this is doing too much and not needed)

@JoelRice-NOAA could you take a look at this and confirm this is working for you now? The best way to do this is the following:

remotes::install_github("nmfs-ost/stockplotr@fix-sb-plt-219")
# using your example file
albacore <- stockplotr::convert_output(output_file)
stockplotr::plot_spawning_biomass(
  dat = albacore,
  era = NULL # this is a key change
  ref_line = c("target" = 10e6),
  unit_label = "mt",
  scale_amount = 1e6,
  relative = TRUE,
  module = "DERIVED_QUANTITIES"
)

This is what I am getting from the example file in stockplotr:

plot_spawning_biomass(stockplotr::example_data, era = NULL)
image

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.

1 participant