yutannihilation / gghighlight

Highlight points and lines in ggplot2
https://yutannihilation.github.io/gghighlight/
Other
522 stars 23 forks source link

Why does this fail with the dev version of ggplot2? #199

Closed yutannihilation closed 2 months ago

yutannihilation commented 2 months ago
library(gghighlight)
#> Loading required package: ggplot2

packageVersion("ggplot2")
#> [1] '3.5.1'

ggplot(mpg, aes(class, after_stat(count), fill = factor(cyl))) +
  geom_bar() +
  gghighlight(cyl >= 8, use_group_by = FALSE)
#> label_key: class


devtools::load_all("~/GitHub/ggplot2/")
#> ℹ Loading ggplot2
library(gghighlight)

ggplot(mpg, aes(class, after_stat(count), fill = factor(cyl))) +
  geom_bar() +
  gghighlight(cyl >= 8, use_group_by = FALSE)
#> Error in `purrr::map()` at gghighlight/R/gghighlight.R:164:3:
#> ℹ In index: 1.
#> Caused by error in `dplyr::transmute()` at gghighlight/R/gghighlight.R:319:3:
#> ℹ In argument: `quasi_parallel(...)`.
#> Caused by error:
#> ! Input must be a vector, not a function.

Created on 2024-07-17 with reprex v2.1.0

yutannihilation commented 2 months ago

Answer to self: no, this doesn't fail. The reprex fails because it does load_all() so the internal object count is leaked to the evaluation.