-
Notifications
You must be signed in to change notification settings - Fork 18
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
v0.5.0 does not add new fill scale in some cases #70
Comments
Thanks for the report. In your example code your using datasets that I don't have access to, so I cannot reproduce the problem. Could you create a minimal reproducible example that uses as few extraneous objects as possible? You can either use build-in dataset or a minimal dataset that you can share here. |
Sure! here are some minimal datasets:
Hope this helps |
This might be a problem unrelated to ggnewscale. I get the same error just trying to plot the sf object. library(ggplot2)
locality_sf <- rnaturalearth::ne_download(
scale = 10,
type = "admin_1_states_provinces",
category = "cultural",
returnclass = "sf"
) |>
dplyr::filter(name == "United States")
ggplot() +
geom_sf(data = locality_sf)
#> Error in `geom_sf()`:
#> ! Problem while setting up geom aesthetics.
#> ℹ Error occurred in the 1st layer.
#> Caused by error in `$<-.data.frame`:
#> ! replacement has 1 row, data has 0 |
I had an issue with the newest version adding a fill scale, but when I reverted to 0.4.10, the issue went away. I was attempting to add a new fill scale via the code below, which had worked before I updated the package and works now that I have reverted.
Here is the error I was receiving:
"Error in
$<-.data.frame
(*tmp*
, ".label", value = c("low", "moderate", : replacement has 4 rows, data has 3".I was able to isolate the issue to the geom_point, which worked if I used fill outside the aes statement as just a single color. But as is, with the geom_point as the 2nd fill scale, the code will work up until the geom_point statement, but will not work if you try to include a second fill scale.
Here is the code I used:
The text was updated successfully, but these errors were encountered: