[R] adjusting the map of France to 1830

Stephane DRAY dray at biomserv.univ-lyon1.fr
Fri Nov 19 00:25:20 CET 2004


Hello. I do not know if you can merge polygons, but you can select easily:

 > departements=map('france',namesonly=T) # returns a vector of names of 
regions
 > map('france',regions=departements[1:20],namesonly=T) # use what you need 
with regions argument

Hope this helps,


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?
>
>Here's what I did in SAS:
>
>*-- Fix the map of France to conform to Guerry:
>    - adjust the 97 current departments to correspond to the 86 in 1830
>    - delete those not part of France then
>;
>
>data gfrtemp;
>    set maps.france;
>    /* Corse was one dept - merge these to one area, new ID */
>    if id in (201, 202)    then dept=200;
>
>    /* Seine et Oise (78) was cut into
>    Essonne (91), Val d'Oise (95) and Yvelines (78) */
>    else if id in (91, 95)    then dept=78;
>
>    /* Seine (75) now split into
>    Hauts-de-Seine (92), Seine-Saint-Denis (93) et Val-de-Marne (94)*/
>    else if id in (92, 93, 94)    then dept=75;
>
>     /* departments not part of France in 1830 */
>    else if id in (
>        6,     /* Alpes-Maritimes */
>        73,74, /* Savoie, Haute-Savoie */
>        90)    /* Territore-de-Belfort */
>        then delete;
>    else                       dept=id;
>    run;
>
>*-- remove internal boundaries based on merged DEPT;
>proc sort data=gfrtemp;
>    by dept;
>
>proc gremove data=gfrtemp out=gfrance;
>   by dept;
>   id id;
>   run;
>
>
>
>--
>Michael Friendly     Email: friendly at yorku.ca Professor, Psychology Dept.
>York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
>4700 Keele Street    http://www.math.yorku.ca/SCS/friendly.html
>Toronto, ONT  M3J 1P3 CANADA
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Stéphane DRAY
-------------------------------------------------------------------------------------------------- 

Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville
Montréal, Québec H3C 3J7, Canada

Tel : (514) 343-6111 poste 1233         Fax : (514) 343-2293
E-mail : stephane.dray at umontreal.ca
-------------------------------------------------------------------------------------------------- 

Web                                          http://www.steph280.freesurf.fr/




More information about the R-help mailing list