ggalt
ggalt copied to clipboard
coord_proj error
When I try to map using coord_proj, I get the error message:
Error in zero_range(from) : x must be length 1 or 2
Example code:
library(maps)
library(ggalt)
library(ggplot2)
world_map <- map_data("world")
world_map <- subset(world_map, region!="Antarctica")
gg <- ggplot(data = world_map, aes(x = long, y = lat, group = group)) +
geom_cartogram(map = world_map, aes(map_id = region))
gg + coord_proj("+proj=robin")
have you installed from github? this was remedied in the github version recently and will be headed to CRAN this week
Yes, I installed the developer version from github.
How recently? I ran your code and that error is not happening.
Just this morning, I'll try to run it on a different computer and see if it works.
cool. thx. ggplot 2.2.1 (the late Dec release) is a requirement and re-installing this after installing that is a requirement (hopefully ggplot2 will stop changing soon after the geom_sf release)
I got it working by reinstalling ggplot2 and ggalt in dev mode and running the code in dev mode. Thanks so much for your help!