Skip to content
Back to formatted view

Raw Message

Message-ID: <alpine.LRH.2.00.0907281756160.7444@reclus.nhh.no>
Date: 2009-07-28T15:58:57Z
From: Roger Bivand
Subject: Using Shapes file to update the "world" map
In-Reply-To: <ce6bbb9d0907280210na924488gd458c4eaadf77d1e@mail.gmail.com>

On Tue, 28 Jul 2009, Sean Carmody wrote:

> I recently began playing around with the maps package, but am definitely a
> novice when it comes to geographic data. While the map function is very easy
> to use, the map data is out of date, particularly when it comes to former
> Soviet Union countries. I have tried to search the archives to work out how
> to update the file, but have become rather stuck. I found these
> instructions: http://spatial.nhh.no/R/etc/world_map_intro.html but could not
> quite follow them.

Please use the wrld_simpl data set bundled with the maptools package, and 
use your choice of its attributes (see names(wrld_simpl) - probably ISO3) 
to key to your data. See spCbind() methods in maptools for control in 
assigning, and review the sp SpatialPolygonDataFrame class used.

Roger

> They did, however, point me to this site
> http://thematicmapping.org/downloads/world_borders.php which has a more up
> to date file of country borders. After downloading this file, I managed to
> read in the shape file using read.shape and then plotted the result using
> Map2poly and this confirmed that the data was good. However, the read.shape
> gave me various error messages about extra data in the file and, although I
> could plot the whole world, I don't know how to identify individual
> countries. Ideally, I would like to take the downloaded border file data and
> convert into file formats that the map function can understand. Any
> suggestions as to how to do this or any alternative approaches would be
> greatly appreciated. To get an idea of what I am trying to do, this post has
> examples using the old map data:
> http://www.stubbornmule.net/2009/07/arms-trade/
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no