Error in geom_map combined with coord_map?

Below is an example from the geom_map help page:

crimes <- data.frame(state = tolower(rownames(USArrests)), USArrests) 
library(reshape2) # for melt 
crimesm <- melt(crimes, id = 1) 
if (require(maps)) { 
  states_map <- map_data("state") 
  ggplot(crimes, aes(map_id = state)) + 
        geom_map(aes(fill = Murder), map = states_map) + 
        expand_limits(x = states_map$long, y = states_map$lat) + 
        coord_map(project = "polyconic") 
} 

      

It gives this error:

Error in validDetails.polygon (x): 'x' and 'y' and 'id' must be the same length

The only change in this example is the addition of the coord_map function.

I think it might be a bug in geom_map, similar to what existed previously in geom_ribbon before it was fixed by Hadley: https://github.com/hadley/ggplot2/issues/112

Can anyone confirm this? If this is a bug, how do I report it?

David

+3


source to share





All Articles