我使用包mapdata使用此代码,但它只显示我选择的三个国家,我看不到世界其他地图边界.
map("world",
regions=c("ethiopia", "kenya", "uganda"),
exact = TRUE,
fill=TRUE,
col=c(1,2,3))
Run Code Online (Sandbox Code Playgroud)
在突出显示我选择的三个国家的同时,如何展示世界其他地图的边界?
EDi*_*EDi 10
这是一个没有rworldmap的例子:
require(mapdata)
# get the names
cc <- map('world', names = TRUE, plot = FALSE)
take <- unlist(sapply(c("ethiopia", "kenya", "uganda"), grep, tolower(cc), value = TRUE))
# world
map()
# add the selected countries in grey to the plot
map('world', regions=take, fill=TRUE, col='grey50', add = TRUE)
Run Code Online (Sandbox Code Playgroud)
