yutannihilation / gghighlight

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

multiple predicates don't work #174

Closed daranzolin closed 3 years ago

daranzolin commented 3 years ago

Reprex::

library(gghighlight)
#> Warning: package 'gghighlight' was built under R version 4.0.5
#> Loading required package: ggplot2

set.seed(2)
d <- purrr::map_dfr(
  letters,
  ~ data.frame(
    idx = 1:400,
    value = cumsum(runif(400, -1, 1)),
    type = .,
    flag = sample(c(TRUE, FALSE), size = 400, replace = TRUE),
    stringsAsFactors = FALSE
  )
)

ggplot(d) +
  geom_line(aes(idx, value, colour = type)) +
  gghighlight(max(value) > 15, mean(flag) > 0.55)
#> label_key: type

Created on 2021-07-19 by the reprex package (v1.0.0)

yutannihilation commented 3 years ago

Hi, I guess you are suggesting to fix the code on the vignette, but it's already fixed by this commit: https://github.com/yutannihilation/gghighlight/commit/08992037c44423adec49bb2caa215c6dd4dff7d5

Thanks for your report anyway!