[R] adjusting the map of France to 1830

Ray Brownrigg ray at mcs.vuw.ac.nz
Fri Nov 19 01:07:41 CET 2004


At 16:29 18/11/2004, Michael Friendly wrote:
> I'm doing some analyses of historical data from France in 1830 on 'moral 
> statistics' that I'd like to
> show on a map.  I've done most of my analyses in SAS, but a few things 
> would work better in R.
> To do this, I have to adjust the modern map,
> 
> library(maps)
> map('france')
> 
> to adjust for changes in departments (86 in 1830, to 97 now).  I've read 
> the documentation
> for the maps and maptools package, but there seems to be no functions to 
> allow this, and
> I can't find information on the exact structure of map datasets, but I 
> understand them to
> be delimited lists of polygon coordinates.
> 
> In SAS, all maps have (one or more) ID variables representing the 
> geographical region,
> and there is also a proc gremove that can remove internal boundaries 
> inside the polygons
> for regions with the same ID.  Is there some way I can do this in R?
>
Unfortunately not with the current implementation of several of the
'extra' databases in the mapdata package.  The map() function does have
the interior=FALSE option, which would normally do what you want, but
only when the data has been manipulated to allow it.  Currently this
option is only useful with the world and usa maps (and their
derivatives, such as world2 and state).

Currently every department is a complete polygon, and so every interior
line segment occurs twice in the data.  What has to happen to the data
is for it to be split up into non-overlapping line segments, and each
polygon reconstructed from a list of these line segments (with
direction being important).

If you are prepared to perform this somewhat tedious process, I am
happy to assist you with further details.

However even with the interior= option functioning, it would still not
be easy to produce the map you would require, since you would have to
build it up from many components (namely each of the 'combined'
departments, plus 'all the rest').

HTH,
Ray Brownrigg




More information about the R-help mailing list