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

Persistent warning when using geom_point suggesting to use annotate #5797

Closed
EA-Ammar opened this issue Mar 24, 2024 · 1 comment
Closed

Comments

@EA-Ammar
Copy link

Providing geom_point with simple x and y parameters now consistently triggers a warning suggesting to use annotate.

This warning is also visible several places on the reference page Position related aesthetics: x, y, xmin, xmax, ymin, ymax, xend, yend, so I assume that this is not working as intended. If it is, I don't understand how annotate is an alternative.

Reproducible example:

library("tidyverse")

# Sample data
dat <- data.frame(xvar = c(1:100),
                  yvar = c(101:200))

# Chart with geom warning
ggplot(dat,
       aes(x = cap,
           y = maint)) + 
  geom_point(aes(x= 5,
                 y = 125))

Resulting in warning:

Warning message:
In geom_point(aes(x = 5, y = 125)) :
All aesthetics have length 1, but the data has 100 rows.
ℹ Did you mean to use annotate()?

@teunbrand
Copy link
Collaborator

This issue is very similar to #5762, so I suggest to continue discussion there to keep it all in one place.

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

2 participants