Is there an R equivalent to SAS's proc gremove? You would use this procedure to combine the units on an existing map, for example to build a map of Metropolitan Statistical Areas (MSAs) from the [US] counties dataset where the internal boundries surround the MSAs (which are groups of counties) rather than the individual counties. I can imagine the mechanism would be to find and erase the boundries within each group. Is there a way to do that in R? I looked at the S reference on building geographical databases, and I could probably fumble through the C code to build the binary files of lines and polygons, but have no idea how to implement the shell program to extract the datapoints. Thanks. [[alternative HTML version deleted]]
Fred Rohde wrote:> Is there an R equivalent to SAS's proc gremove? You would use this procedure to combine > the units on an existing map, for example to build a map of Metropolitan Statistical Areas> (MSAs) from the [US] counties dataset where the internal boundries surround the MSAs (which > are groups of counties) rather than the individual counties. This sounds like the standard GIS 'dissolve' function. Its probably a bad idea to try and give R all the GIS functions on the planet - better to link it with a GIS and use that instead. GRASS-GIS can do a dissolve operation, using v.reclass with the -d option. See http://grass.itc.it/gdp/html_grass5/html/v.reclass.html Of course you'll then need some way of getting your data into and out of GRASS, there's a GRASS R library by Roger Bivand that might help and an R-Arc/Info lib by Virgilio Gomez-Rubio that also might help. Doing it from R's 'maps' format could be fun though... for some definition of 'fun'... Barry
> Is there an R equivalent to SAS's proc gremove? You would use this procedure to combine the units on an existing map, for example to build a map of Metropolitan Statistical Areas (MSAs) from the [US] counties dataset where the internal boundries surround the MSAs (which are groups of counties) rather than the individual counties. I can imagine the mechanism would be to find and erase the boundries within each group. Is there a way to do that in R? I looked at the S reference on building geographical databases, and I could probably fumble through the C code to build the binary files of lines and polygons, but have no idea how to implement the shell program to extract the datapoints. Thanks. >It's already built in to the maps package. Try e.g.: map("county", c("arizona,gila", "arizona,maricopa", "arizona,yavapai"), interior=F) [I wouldn't have believed that it worked until I tried!] Hope this helps, Ray Brownrigg