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

gghighlight fails to label points with lines when there are no group #136

Open
yutannihilation opened this issue Mar 11, 2020 · 0 comments

Comments

@yutannihilation
Copy link
Owner

Originally reported at: https://community.rstudio.com/t/gghighlight-label-key-producing-error/56052

library(tidyverse)
library(gghighlight)

set.seed(47)
df <- tibble::tibble(
  a = seq(0, 100, by = 5),
  b = runif(21)
)

library(tidyverse)
library(gghighlight)

set.seed(47)
df <- tibble::tibble(
  a = seq(0, 100, by = 5),
  b = runif(21)
)

ggplot(df) +
  aes(x = a, y = b) + 
  geom_line() +
  geom_point() +
  gghighlight(b == max(b), label_key = a) +
  theme_minimal()
#> Error: `vars` must be a character vector

ggplot(df) +
  aes(x = a, y = b) + 
  geom_line() +
  geom_point() +
  gghighlight(b == max(b), label_key = a, n = 1) +
  theme_minimal()

Created on 2020-03-11 by the reprex package (v0.3.0)

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

No branches or pull requests

1 participant