Skip to content
Prev 21255 / 29559 Next

maps showing post-Soviet states?

Thanks to Gilles Leduc, Greg Snow, Thomas Adams, Barry 
Rowlingson, and Michael Sumner for their replies.  For the archives, in 
case someone else might find this in the archives, I will record here 
two solutions to my problem.


       1.  Michael's reply was the simplest, especially since it worked 
with "map" adding "add=TRUE" and "col" to the plot:

map(xlim=c(10, 90), ylim=c(30, 60))
library(raster)
ct <- getData("countries")
plot(subset(ct, NAME %in% c("Azerbaijan", "Uzbekistan", "Tajikistan",
                             "Turkmenistan", "Croatia")),
             add=TRUE, col='red')


       2.  Before I saw Michael's reply, I had solved the problem with 
much greater effort:  (1) I downloaded a zip file for each country from 
"www.diva-gis.org/datadown", as suggested by Gilles. (2) Unzipping 
produced folders with names like "..\TWN_adm" and files with names 
beginning "TWN_adm0", "TWN_adm1", and "TWN_adm2" and extensions bdf, 
prj, sbn, sbx, shp, and shx.  I could then get what I wanted with code 
like the following:


Taiwan0 <- readShapeSpatial("..\TWN_adm0")
map(xlim=c(100, 150), ylim=c(10, 30))
plot(Taiwan0, add=TRUE, col='blue', lwd=3, fill=FALSE)


       Again, thanks for the replies.
On 7/1/2014 4:38 PM, Michael Sumner wrote: