ggalt icon indicating copy to clipboard operation
ggalt copied to clipboard

coord_proj error

Open pbaine opened this issue 8 years ago • 6 comments

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")

pbaine avatar Feb 13 '17 16:02 pbaine

have you installed from github? this was remedied in the github version recently and will be headed to CRAN this week

hrbrmstr avatar Feb 13 '17 16:02 hrbrmstr

Yes, I installed the developer version from github.

pbaine avatar Feb 13 '17 16:02 pbaine

How recently? I ran your code and that error is not happening.

hrbrmstr avatar Feb 13 '17 16:02 hrbrmstr

Just this morning, I'll try to run it on a different computer and see if it works.

pbaine avatar Feb 13 '17 16:02 pbaine

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)

hrbrmstr avatar Feb 13 '17 16:02 hrbrmstr

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!

pbaine avatar Feb 13 '17 17:02 pbaine