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

False positive warning on the use of size aesthetics on geom_sf() #4960

Closed
yutannihilation opened this issue Aug 23, 2022 · 2 comments
Closed

Comments

@yutannihilation
Copy link
Member

I think this is minor (and not sure if this can be fixed), so it should be fine if this won't be fixed before the release.

library(ggplot2)

pts <- sf::st_sf(
  geometry = sf::st_sfc(sf::st_point(0:1), sf::st_point(1:2)),
  size = c(1, NA),
  shape = c("a", NA),
  colour = c("red", NA)
)

# OK
b1 <- ggplot_build(ggplot(pts) + geom_sf(aes(size = size)))

# False positive
b2 <- ggplot_build(ggplot(pts, aes(size = size)) + geom_sf())
#> size aesthetic has been deprecated for use with lines as of ggplot2 3.4.0
#> ℹ Please use linewidth aesthetic instead
#> This message is displayed once every 8 hours.

Created on 2022-08-24 with reprex v2.0.2

@yutannihilation
Copy link
Member Author

I noticed this because this line shows the warning.

expect_identical(grob_xy_length(p + aes(size = size)), c(1L, 1L)),

yutannihilation added a commit to yutannihilation/ggplot2 that referenced this issue Aug 24, 2022
@yutannihilation
Copy link
Member Author

Resolved by #4964

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