我想用Rstudio绘制夏威夷群岛。我试过ggmap和ggplot2。有没有人有任何其他建议?
library(ggplot2)
library(maps)
all_states <- map_data("state")
p <- ggplot() + geom_polygon(data=all_states,
aes(x=long, y=lat, group = group),
color="white", fill="lightgreen" ) +
geom_point( data=mapdata, aes(x=long, y=lat), color="red") +
geom_text( data=mapdata, aes(long, lat, label = mapdata$Location),
hjust = -.10, size=3, angle = 15, color = "black")
除了安德鲁的建议,你也可以尝试包"usmap"
,它包括夏威夷。
尝试
install.packages("usmap")
library(usmap)
usmap::plot_usmap(include = c("HI"))
有关如何修改地图的更多详细信息,请参阅https://cran.r-project.org/web/packages/usmap/vignettes/mapping.html。