Skip to content

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

Closed
@yutannihilation

Description

@yutannihilation

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions