[R] Selecting single TAZ based on area proportion

LCOG1 jroll at lcog.org
Mon Feb 8 19:14:13 CET 2010


Good day all, 
   I am having an issue coercing my data.  Below i have some data on taxlots
and an associated TAZ(transportation analsysi zone) that each property is
within.  The main issue is that some properties cross TAZ boundaries so i
need to make a decision as to which TAZ the property belongs too, i would
like to do this based on the area of the Property and ultimately assign the
the property to the TAZ in which the majority or the most of the area is
within.  For instance in the data below:

Property  p754921  is in two TAZs, 38 and 37.  Since the property is mostly
in 37 i would like to assign this value to the list of properties(Props) so
that 

MultiTazProperties_ goes from 

$p754921
[1] 38 37 37

$p75506
[1] 171 171 282 171

$p75508
[1]  46  46 169 169 169

to....

$p754921
[1]  37 

$p75506
[1] 282

$p75508
[1]  46

     Props    TAZ       Area
1  p754921  38 109828.040
2  p754921  37 128134.710
3  p754921  37  46469.570
4   p75506 171  37160.210
5   p75506 171  40080.500
6   p75506 282 344679.660
7   p75506 171  16972.280
8   p75508  46 342309.558
9   p75508  46 260906.870
10  p75508 169  17014.659
11  p75508 169   7285.706
12  p75508 169  10936.316
> 


#Data to use
Props<-c("p754921","p754921" ,"p754921","p75506" ,"p75506"
,"p75506","p75506"
 ,"p75508","p75508","p75508","p75508","p75508")
TAZ<-c(38,37,37,171,171,282,171,46,46,169,169,169)
Area<-c(109828.04,  128134.71,   46469.57, 37160.21, 
40080.50,344679.66,16972.28,
342309.558, 260906.870,  17014.659,   7285.706,  10936.316)

TazProperties..<-data.frame(Props,TAZ,Area)

MultiTazProperties_<-tapply(TAZ , Props, function(x) x)
MultiTazArea_<-tapply(Area , Props, function(x) x)

Hope my inquiry is clear.  Thanks
-- 
View this message in context: http://n4.nabble.com/Selecting-single-TAZ-based-on-area-proportion-tp1473288p1473288.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list