Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use group aes if available #77

Merged
merged 3 commits into from
Dec 28, 2018
Merged

Use group aes if available #77

merged 3 commits into from
Dec 28, 2018

Conversation

yutannihilation
Copy link
Owner

@yutannihilation yutannihilation commented Dec 28, 2018

Fix #68

Do as ggplot2 does: https://github.com/tidyverse/ggplot2/blob/3e1e6e43af82faf59e37df0724b65c8d829c7b07/R/grouping.r#L11-L28

library(gghighlight)
#> Loading required package: ggplot2

set.seed(2)
d <- data.frame(x = c(1,2,1,2),
                y = c(1,3,2,4),
                group = c("a", "a", "b", "b"),
                flag = c(1, 1, 0, 1))

ggplot(d, aes(x, y, group = group)) +
  geom_line() +
  gghighlight(sum(flag) > 1)
#> label_key: group

Created on 2018-12-28 by the reprex package (v0.2.1)

@yutannihilation yutannihilation merged commit c278d0a into master Dec 28, 2018
@yutannihilation yutannihilation deleted the fix-group-variable branch December 28, 2018 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant