# NOT RUN {
d <- data.frame(
idx = c( 1, 1, 1, 2, 2, 2, 3, 3, 3),
value = c( 1, 2, 3,10,11,12, 9,10,11),
category = rep(c("a","b","c"), 3),
stringsAsFactors = FALSE
)
gghighlight_line(d, aes(idx, value, colour = category), max(value) > 10)
# }
# NOT RUN {
# This throws an error because the predicate returns multiple values per group.
gghighlight_line(d, aes(idx, value, colour = category), value > 10)
# }
# NOT RUN {
gghighlight_point(d, aes(idx, value), value > 10, label_key = category)
# }
Run the code above in your browser using DataLab