Via larmarange/ggstats#126 I stumbled upon the fact that using a named vector as faceting variable emits an error for options(warn = 2, warnPartialMatchAttr = TRUE):
df <- list2DF(list(
x = 1:2,
y = 1:2,
facet = setNames(
factor(c("a", "b")),
c("one", "two")
)
))
ggplot2::ggplot(df, ggplot2::aes(x, y)) +
ggplot2::geom_point() +
ggplot2::facet_grid(rows = ggplot2::vars(facet))
Error in `attr()`:
! (converted from warning) partial argument match of 'n' to 'names'
Backtrace:
▆
1. ├─base (local) `<fn>`(x)
2. ├─ggplot2 (local) `print.ggplot2::ggplot`(x)
3. │ ├─ggplot2::ggplot_build(x)
4. │ └─ggplot2 (local) `ggplot_build.ggplot2::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. │ └─ggplot2 (local) compute_layout(..., self = self)
9. │ └─ggplot2:::id(base, drop = TRUE)
10. │ └─ggplot2:::id_var(.variables[[1]], drop = drop)
11. └─base::warning(cond)
12. └─base::withRestarts(...)
13. └─base (local) withOneRestart(expr, restarts[[1L]])
14. └─base (local) doWithOneRestart(return(expr), restart)
It may be necessary to pass exact = TRUE to attr().
Via larmarange/ggstats#126 I stumbled upon the fact that using a named vector as faceting variable emits an error for
options(warn = 2, warnPartialMatchAttr = TRUE):It may be necessary to pass
exact = TRUEtoattr().