[R-sig-Geo] maps showing post-Soviet states?

Spencer Graves spencer.graves at prodsyse.com
Wed Jul 2 02:57:41 CEST 2014


       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:
> An example:
>
> library(raster)
> ct <- getData("countries")
> plot(subset(ct, NAME %in% c("Azerbaijan", "Uzbekistan", "Tajikistan",
> "Turkmenistan", "Croatia"))
>
>
>
>
> On Wed, Jul 2, 2014 at 9:09 AM, Michael Sumner <mdsumner at gmail.com> wrote:
>
>>
>> On Wed, Jul 2, 2014 at 7:56 AM, Thomas Adams <tea3rd at gmail.com> wrote:
>>
>>> Spencer,
>>>
>>> Maybe I'm not sure what you're asking but here
>>> http://www.gadm.org/version1
>>> are current shapefiles by country. The highlighting (selection) canals  be
>>> done in GRASS GIS, QGIS, GMT
>>>
>>>
>>   raster::getData can read this. See here http://www.gadm.org/ and
>>
>> library(raster)
>> ?getData
>>
>>
>>
>>
>>
>>
>>> Tom
>>>
>>>
>>> On Tue, Jul 1, 2014 at 2:29 PM, Spencer Graves <
>>> spencer.graves at prodsyse.com>
>>> wrote:
>>>
>>>>        What would you suggest I do to create a world map highlighting
>>>> Taiwan and post-Soviet states like Azerbaijan, Uzbekistan, Tajikistan,
>>>> Turkmenistan, and Croatia?
>>>>
>>>>
>>>>        The region argument in maps::map won't recognize any of these, and
>>>> my literature search identified hundreds of packages with some spatial /
>>>> geographical / mapping content.
>>>>
>>>>
>>>>        Thanks,
>>>>        Spencer Graves
>>>>
>>>> _______________________________________________
>>>> R-sig-Geo mailing list
>>>> R-sig-Geo at r-project.org
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>
>>>
>>> --
>>> Michael Sumner
>>> Software and Database Engineer
>>> Australian Antarctic Division
>>> Hobart, Australia
>>> e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list