-1

我通常去网站: http ://gadm.org 找到我想用 R 绘制的国家的轮廓。但是今天,这个网站关闭了,我不知道如何着手有一个真正准确的地图...

当我尝试:

library(maps)
map("world", xlim=c(15,23), ylim=c(45.5,49))

该国的轮廓不是很准确...

我试图找到一个可以给出轮廓的其他网站,但我没有找到。

有人可以帮助我吗?

4

1 回答 1

7

好的,假设您想使用来自 Natural Earth 的数据绘制法国等高线:

# First download the data in your working directory
download.file("http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip", "countries.zip")
# Then unzip
unzip("countries.zip")
# Load maptools
library(maptools)
# Read in the shapefile
world <- readShapeSpatial("ne_10m_admin_0_countries.shp")
# Plot France
plot(world[world$ADMIN=="France",1]) 
# Column 1 is the id column, column "ADMIN" contains the country names
于 2013-10-09T08:58:26.117 回答