开发者

Map Data with R World Regions

Lately I have seen some cool examples of mapping in R and wanted to give this a shot. I currently have ArcView at work, but my s开发者_JAVA技巧patial join is not working correctly (most likely user error).

Objective: I need a list of countries and what World Region they belong to. I have two layers (one country detail, the other region detail) and wanted to join the world region assignment onto each country. The join isn't working, so i figured I would come to the R community.

What are my options? This is my first attempt at doing any mapping in R and maybe there is an easier/better solution. Eventually I want to take lat/long data and map it as well.

Any insight will be much appreciated.

Brock


See the Spatial task view on CRAN, and packages like maps/mapdata, sp, rgdal, raster, blighty, rworldmap, RgoogleMaps, etc.

Do you have shapefiles you want to read? First get rgdal installed, or look at other options like maptools and shapefiles if that is difficult on your platform. Read functions in these packages will provide Spatial*DataFrame objects.

For information on the Spatial classes:

library(sp)
vignette("sp")

spatstat also has a lot of support for spatial data, and another vignette for converting to / from sp:

library(spatstat)
vignette("shapefiles")


The PBSmapping package is another good place to start. They have pretty extensive documentation and a great reference manual as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜