我正在尝试制作一些特定国家的等值线地图。我有带有等值线地图值的数据,而我没有数据的其他国家将被绘制为灰色。
所以这是我到目前为止的代码:
data_iso = data.frame(region=c("Argentina", "Brazil", "Chile", "Colombia", "Costa Rica", "Mexico", "Panama", "Peru", "El Salvador"),
ratemort = c(25.510391, 73.875825,20.297896, 73.557939 ,23.266236, 42.190321, 48.069608, 9.971303 ,109.941822))
library(ggmap)
library(ggplot2)
library(raster)
library(maptools)
mapa <- borders("world", regions = c("Brazil", "Uruguay", "Argentina", "French Guiana", "Suriname", "Colombia", "Venezuela",
"Bolivia", "Ecuador", "Chile", "Paraguay", "Peru", "Guyana", "Panama", "Costa Rica",
"Nicaragua", "Honduras", "El Salvador", "Belize", "Guatemala", "Mexico", "Trinidad and Tobago",
"Caribe", "Puerto Rico", "Dominican Republic", "Haiti", "Jamaica", "Cuba", "Bahamas", "Antiles",
"Dominica", "Saba"),
fill = "grey70", colour = "black")
ggplot() + mapa + theme_bw() + xlab("Longitude (decimals)") + ylab("Latitude (decimals)") +
theme(panel.border = element_blank(), panel.grid.major = element_line(colour = "grey80"), panel.grid.minor = element_blank())
然后,我想添加data_iso$ratemort
他们各自国家的值。
有什么建议吗?