-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Sizing geom_sf point data with variable containing NAs #3483
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
Comments
Hmm, this change (I'm not sure if we call this a "regression") seems introduced in v3.2.0... The code used to work before: library(ggplot2)
#> Registered S3 methods overwritten by 'ggplot2':
#> method from
#> [.quosures rlang
#> c.quosures rlang
#> print.quosures rlang
packageVersion("ggplot2")
#> [1] '3.1.1'
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
nc_3857 <- sf::st_transform(nc, "+init=epsg:3857")
nc_3857$mid <- sf::st_centroid(nc_3857$geometry)
nc_3857$AREA[10] <- NA
ggplot(nc_3857) +
geom_sf(aes(geometry = mid, size = AREA)) Created on 2019-08-13 by the reprex package (v0.3.0) The error comes from here in Lines 159 to 162 in fc8f7d5
Since grid::gpar(fontsize = NA)
#> named list()
grid::gpar(fontsize = c(1, NA))
#> Error in checkNA("fontsize"): mixture of missing and non-missing values for fontsize Created on 2019-08-13 by the reprex package (v0.3.0) Now that it's vectorized, it seems we need to replace |
Now I'm sure it should not. Probably, Lines 67 to 72 in b842024
|
Sorry, I was wrong here. It seems |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
Trying to plot point data with
geom_sf()
that has a mapping to a variable that contains NAs creates an error. This occurs both in the CRAN 3.2.1 and development versions.Created on 2019-08-13 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: