Skip to content

plot_indices() cannot accommodate a numeric group argument #212

@kellijohnson-NOAA

Description

@kellijohnson-NOAA

Within FIMS, we have module == "Fleet" and right now we are not automatically able to pass fleet names from R to the C++ so we are relying on module_id to differentiate between the fleets. So, I passed module_id to stockplotr::plot_indices() as the group and I got the following error because module_id is a numeric value. It would be great if {stockplotr} could accommodate numeric groups where it just turns them into a character for you.

stockplotr::plot_indices(
  dat = dplyr::mutate(output_fims,
    label = dplyr::if_else(label == "index_expected", "indices", label)
  ) |>
    dplyr::filter(!is.na(observed)),
  group = "module_id"
)

Error in `ggplot2::geom_point()`:
! Problem while computing aesthetics.
i Error occurred in the 1st layer.
Caused by error in `scale_f()`:
! A continuous variable cannot be mapped to the shape aesthetic.
i Choose a different aesthetic or use `scale_shape_binned()`.
Run `rlang::last_trace()` to see where the error occurred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions