我是sf的新手。在下面的代码中,我生成了两个地图,一个是美国的,另一个是澳大利亚的。我想将这两个地图并排放在同一个ggplot中。我尝试过更改geometry中澳大利亚的longitude和latitude值。我只是想知道是否有快速的方法来实现这一点。任何建议都将不胜感激。
library(tidyverse)
library(sf)
library(rnaturalearth)
map_au <-ne_states(country = c("australia"), returnclass ="sf") %>%
select(state = name, geometry)
map_us <-ne_states(country = c("united states of america"), returnclass ="sf") %>%
select(state = name, geometry) %>%
filter(!state %in% c("Alaska", "Hawaii"))
ggplot(data = map_us, aes(fill = state))+
geom_sf()+
geom_sf(data = map_au)+
theme(legend.position = "none")
这是由reprex package (v0.3.0)于2020年11月04日创建的