3
我目前正在使用地理數據來映射它們。我有兩個不同的shapefile。我所要做的是在加拿大和美國之間增加一個大膽的邊界,我不知道如何做到這一點。r在美國和加拿大之間添加粗體邊界。
# Load packages ----------------------------------------------------------------
library(dplyr)
library(readr)
library(ggplot2)
library(rgdal)
library(ggmap)
# Load data --------------------------------------------------------------------
canada <- readOGR(dsn = "00-raw/gcd_000b11a_e/", layer = "canada") %>% fortify()
us <- readOGR(dsn = "00-raw/usmaps/us/", layer = "co99_d90") %>% fortify()
# Maps -------------------------------------------------------------------------
gg <- ggplot() + geom_map(data=canada, map=canada,
aes(long, lat, map_id=id),
size=0.1, fill=NA, color = "black") +
coord_map("stereographic", xlim=c(-120, -60)) +
geom_map(data=us, map=us,
aes(long, lat, map_id=id),
size=0.1, fill=NA, color = "black") +
theme_nothing(legend = T)