I have a map of dispersed parts in the Us. This is in the following question (that contains link to the data):
mapping by ggplot2 geom_polygon goes crazy after merging data
It was answered very well. Then I tried to add the US border line, therefore I added the geom_path to the answered code,but no result, it creates the same map just containing the dispersed areas.
library(ggplot2)
#library(tidyverse)
library(dplyr)
library(maps)
load("./data.rda")
usa <- map_data("usa")
shape_map <- tbl_df(fortify(shape, region="Name"))
colnames(shape_map) <- c("long", "lat", "order", "hole", "piece", "region", "group")
ggplot() +
geom_path(data = usa, aes(long, lat, group=group))+
geom_map(data=shape_map, map=shape_map, aes(long, lat, map_id=region)) +
geom_map(
data=filter(prop.test, season=="DJF"),
map=shape_map, aes(fill=prop.mega, map_id=megaregion)
)
I have tried geom_polygon() and geom_maps(). no difference. What's the reason, and how can it be solved?
Thank you so much for your help!