Skip to content

[Fix] plot_indices#221

Merged
Schiano-NOAA merged 6 commits intodevfrom
fix-indices-plt
Apr 8, 2026
Merged

[Fix] plot_indices#221
Schiano-NOAA merged 6 commits intodevfrom
fix-indices-plt

Conversation

@Schiano-NOAA
Copy link
Copy Markdown
Collaborator

Make changes per issues #212 & #214

A new function gets created so that we can do the same plotting for other observed and predicted plot comparisons.

I also made an adjusted to process data so that the resulting df indexing variables are all character format.

@Schiano-NOAA
Copy link
Copy Markdown
Collaborator Author

@sbreitbart-NOAA for some reason, exporting the rda for plot_indices is not working now. Could you ID the issue and potentially fix it? It might be due to the facetting, but I'm not sure.

Here is an example:

plot_indices(example_data, make_rda = TRUE)
Error in if (file.exists(fs::path(dir, "captions_alt_text.csv"))) { : 
  argument is of length zero

@sbreitbart-NOAA
Copy link
Copy Markdown
Collaborator

sbreitbart-NOAA commented Apr 3, 2026

@sbreitbart-NOAA for some reason, exporting the rda for plot_indices is not working now. Could you ID the issue and potentially fix it? It might be due to the facetting, but I'm not sure.

Here is an example:

plot_indices(example_data, make_rda = TRUE)
Error in if (file.exists(fs::path(dir, "captions_alt_text.csv"))) { : 
  argument is of length zero

The plot_indices.R file isn't up-to-date with that on the main branch, which contains the new key quantities extraction/insertion pipeline. Try a rebase?

Copy link
Copy Markdown
Collaborator

@sbreitbart-NOAA sbreitbart-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updates look good to me but the tests are failing. Does the example dataset need to be updated? The first test passes with the stockplotr::example_data whereas it fails with the test's dataset.

@Schiano-NOAA
Copy link
Copy Markdown
Collaborator Author

@sbreitbart-NOAA I'll check. My checks passed but something happened with my other branch where a change got overwritten so maybe this happened here or something

@Schiano-NOAA
Copy link
Copy Markdown
Collaborator Author

@sbreitbart-NOAA I found the issue! The example data in the test only had one fleet which caused an error in faceting. I made a check if there as only one fleet (or grouping) to not do this action.

The checks are all passing for me now and the cmd check was good. Good to merge?

@sbreitbart-NOAA
Copy link
Copy Markdown
Collaborator

@sbreitbart-NOAA I found the issue! The example data in the test only had one fleet which caused an error in faceting. I made a check if there as only one fleet (or grouping) to not do this action.

The checks are all passing for me now and the cmd check was good. Good to merge?

Great! Good to merge 👍

@Schiano-NOAA Schiano-NOAA merged commit 02d4608 into dev Apr 8, 2026
1 check passed
@Schiano-NOAA Schiano-NOAA deleted the fix-indices-plt branch April 9, 2026 20:41
Schiano-NOAA added a commit that referenced this pull request Apr 15, 2026
* [Fix] bugs identified in plot_recruitment (#220)

* add in optional ggplot args

* adjust process data so grouping is correctly adjusted based on model condition and grouping

* change default model as 1 from NA

* set plot to look for only recruitment and not rec exp or obs

* allow users to access ggplot geom args

* fix maggritr in pipe

* Update "SSB" to "SB" in captions/alt text/key quantities csvs

* [Fix] plot_indices (#221)

* initial commit of new obs v pred plot

* adjust process data so it converts all indexed data to character to function even when input values are numeric per #212

* update plot indices to use new plot_obsvpred function and adjust based on needs

* update documentation for package

* adjust plot_indices where nfleet = 1 and update test to remove new file produced

* add missing dependency

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

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

* adjust reference label to replace underscore with space

* update ref line documentation

* fix commit from overwrite when rebasing

* fixes to plot including adjusting missing legend

* add back in ggplot options

* adjust plot ts to stop error from color label

* adjust conditions where legend is remove

* Add GitHub Action to regenerate example_data when convert_output.R changes (#229)

* Initial plan

* Add GitHub Action to update example_data when convert_output.R changes

Agent-Logs-Url: https://github.com/nmfs-ost/stockplotr/sessions/16147f90-2416-4af0-a517-a1d297703e33

Co-authored-by: Schiano-NOAA <125507018+Schiano-NOAA@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Schiano-NOAA <125507018+Schiano-NOAA@users.noreply.github.com>

* Update tests to remove key_quantities.csv when complete

* Address plot_recruitment_deviations() documentation review suggestions (#227)

* Address most suggestions as per #198

* Add details section

* Update documentation

* update version

---------

Co-authored-by: sbreitbart-NOAA <sophie.breitbart@noaa.gov>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Schiano-NOAA added a commit that referenced this pull request Apr 16, 2026
* initial commit of new obs v pred plot

* adjust process data so it converts all indexed data to character to function even when input values are numeric per #212

* update plot indices to use new plot_obsvpred function and adjust based on needs

* update documentation for package

* adjust plot_indices where nfleet = 1 and update test to remove new file produced

* add missing dependency
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.

plot_indices() shows observed as line instead of points plot_indices() cannot accommodate a numeric group argument

2 participants