teunbrand / ggh4x

ggplot extension: options for tailored facets, multiple colourscales and miscellaneous
https://teunbrand.github.io/ggh4x/
Other
534 stars 32 forks source link

Margins Error #121

Closed GrandValleyTutor closed 6 months ago

GrandValleyTutor commented 10 months ago

This package looks great!

facet_nested and facet_grid with margins = TRUE gives the following message:

Error in unrowname(): ! Can only remove rownames from and objects.

Backtrace: ▆

  1. ├─base (local) <fn>(x)
  2. └─ggplot2:::print.ggplot(x)
  3. ├─ggplot2::ggplot_build(x)
  4. └─ggplot2:::ggplot_build.ggplot(x)
  5. └─layout$setup(data, plot$data, plot$plot_env)
  6. └─ggplot2 (local) setup(..., self = self)
  7. └─self$facet$compute_layout(data, self$facet_params)
  8. └─ggh4x (local) compute_layout(..., self = self)
  9. └─ggh4x:::reshape_add_margins(...)
    1. └─ggh4x:::unrowname(lapply(df[vars], add_all))
    2. └─cli::cli_abort(...)
    3. └─rlang::abort(...)
teunbrand commented 6 months ago

Thanks for the report! Can confirm this is buggy.