[R] Creating a map with central Asian countries

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Thu Sep 15 10:57:49 CEST 2011


On Thu, Sep 15, 2011 at 8:41 AM, Salaam Batur <swordlight20 at gmail.com> wrote:
> Dear all,
>
> I am trying to create a map for central asian countries(Kazakhstan,
> Uzbekstan, Kyrgyzstan, Turkmenstan, and Tajikstan). I tried google for
> shapefiles and Rdata files of central asia, but I can't seem to find them.
> There is only a world map and individual maps for each countries. If I use
> individual maps to create this map, how do I put them on a same graphic with
> different colours? Any ideas?

 If you are reading the country shapefiles (I get mine from
www.gadm.org) into SpatialPolygonsDataFrames with the readShapeSpatial
function from package:maptools then you could either 'rbind' the five
countries into one SpatialPolygonsDataFrame or do an empty plot with
the lat-long bounds and then plot them with 'add=TRUE'. Something like
(I've not tested this)

tajikistan = readShapeSpatial("TJK_adm0.shp")
plot(0,xlim=c(64,78),ylim=c(35,42))   # maybe other options for axis
and labels here
plot(tajikistan,add=TRUE)

 Any problems with maps, shapefiles etc are probably best asked on
r-sig-geo mailing list, or www.stackoverflow.com with an R tag...

Barry



More information about the R-help mailing list