[R] R Map using SAS data

Michael Friendly friendly at yorku.ca
Thu Sep 25 17:06:59 CEST 2008


SAS map datasets are just ordinary data sets containing variables X, Y 
(lat/long), a region ID variable, perhaps a DENSITY variable (used to
select lower-resolution versions), and perhaps a SEGMENT variable
if a region has two or more disconnected polygons.

For some maps, there is another dataset containing additional 
information about each region; e.g., for France, there is
a maps.france2 containing the name of each department and other

Use proc contents to see what is there:

proc contents data=maps.france; run;
proc contents data=maps.france2; run;

I have a SAS macro, map2gen, that converts these to ArcView 'generate'

Your mileage may vary, but hope this helps.

You should know that SAS map datasets are proprietary (``not free'') and
they are provided in an arbitrary (and non-public) coordinate system.
You can do a wide variety of different map projections with proc 
gproject, but, AFAIK, you won't know exactly what coordinate system
you have in any map you can export. This only matters if you want to
use tools in the sp package that depend on knowing the proj4 string
that identifies the details of a particular map projection.

In general, you'll more & better help if you subscribe & post to r-sig-geo.


Junjie Zhang wrote:
> Hi there,
> I'd like to plot some maps.  Is it possible for me to use SAS map data in R?  Thank you.
> Best,
> Junjie
> _________________________________________________________________

Michael Friendly     Email: friendly AT yorku DOT 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

More information about the R-help mailing list