Re: [R] Selecting single TAZ based on area proportion

2010-02-10 Thread ROLL Josh F
Subject: Re: [R] Selecting single TAZ based on area proportion try this t - TazProperties.. v - aggregate(t$Area, by=list(t$TAZ,t$Props), sum) names(v) - c(TAZ, Prop, area) tapply(v$area, v$Prop, function(x) v$TAZ[which.max(x)]) note that you have to deal with the cases where there is a tie

[R] Selecting single TAZ based on area proportion

2010-02-08 Thread LCOG1
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

Re: [R] Selecting single TAZ based on area proportion

2010-02-08 Thread Nikhil Kaza
try this t - TazProperties.. v - aggregate(t$Area, by=list(t$TAZ,t$Props), sum) names(v) - c(TAZ, Prop, area) tapply(v$area, v$Prop, function(x) v$TAZ[which.max(x)]) note that you have to deal with the cases where there is a tie for the maximum. The above just returns the first maximum.