You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using negated selections in across() (e.g. !a or !(a:b)) the negated variable(s) can't subsequently be used with the .by argument in dplyr's verbs.
library(dplyr, warn.conflicts=FALSE)
dat<- tibble(
a= rep(c("a", "b"), 2),
b=1:4,
c=5:8
)
dat|>
summarise(across(!a, mean), .by=a)
#> Error in `summarise()`:#> ℹ In argument: `across(!a, mean)`.#> Caused by error in `across()`:#> ! Can't select columns that don't exist.#> ✖ Column `a` doesn't exist.
When using negated selections in
across()
(e.g.!a
or!(a:b)
) the negated variable(s) can't subsequently be used with the.by
argument in dplyr's verbs.Created on 2024-03-29 with reprex v2.1.0
There are many obvious workarounds but I would have imagined the above would work.
The text was updated successfully, but these errors were encountered: