The below gives overlaying polygons, how to fix it?
library(ggplot2)
ggplot(data = map_data("state")) + geom_polygon(aes(long, lat, group = region),
color = "red", fill = "red", alpha = 0.2)
You shoud use group = group
as an argument of geom_poly
please see as below:
library(ggplot2)
ggplot(data = map_data("state")) +
geom_polygon(aes(long, lat, group = group),
color = "red", fill = "red", alpha = 0.2)