hadley/ggplot2 — Issue #363: geom_map() buglet
Author: djmurphy420
Created: 2012-01-20 01:59:04+00:00
State: open

Issue: Values are not mapped properly to polygons in geom_map()

Example:

crimes <- data.frame(state = tolower(rownames(USArrests)), USArrests)
crimes$testvar <- 1
# Everything's bigger in Texas!!
crimes$testvar[43] <- 20
crimes[40:43, ]
# ...but Ohio lights up.
ggplot(crimes, aes(map_id = state)) +
geom_map(aes(fill = testvar), map = states_map) +
expand_limits(x = states_map$long, y = states_map$lat)