

 

> Date: Fri, 21 Jan 2011 08:11:20 +0100
> From: Roger.Bivand@nhh.no
> To: mbh02@live.com
> CC: r-sig-geo@r-project.org
> Subject: Re: [R-sig-Geo] Creating Regions With a Dummy Variable Identifier
> 
> On Thu, 20 Jan 2011, Matthew Hasbrouck wrote:
> 
> >
> > Hello everyone,
> >
> > I am a graduate student currently working with census tract data. I have 
> > identified census tracts as either having a certain characteristic or 
> > not, using a dummy variable. This variable is coded as 1 if the tract 
> > has that characteristic and 0 if it doesn't. I would like to take all 
> > contiguous tracts coded as 1 and dissolve them into single records. What 
> > would be left are all of the original tracts that do not have this 
> > characteristic, coded as 0, and records for the larger dissolved areas 
> > that contained this characteristic. I originally thought the SKATER 
> > function might work, but I don't think it will work properly with a 
> > dummy variable.
> 
> Please see ?unionSpatialPolygons in maptools. You'll need to construct a 
> new set of ID values, with your tracts to be dissolved having the same ID, 
> and all the others having their own different IDs. Note the warning about 
> the license of gpclib in case you are affected.
> 
> Roger
> 
> >
> > Thanks,
> > Matt
> > [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
> 
> -- 
> 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@nhh.no
> 
 
 
I think I understand a way to do this using unionSpatialPolygons if I
have a fairly small number of tracts.  I could view a map of the dummy
variable and manually give a unique ID to all tracts in a particular
cluster.  I could continue doing that for all other clusters.  Then I
could save the shapefile and union them in R.  The problem is
that I am dealing with over 9,000 tracts in 91 cities.  Is there a
systematic way to identify all of the contiguous 1's (on the dummy
variable) and give them an ID?

Thanks,
Matt
 

  		 	   		  
	[[alternative HTML version deleted]]

