Displaying 2 results from an estimated 2 matches for "tazproperti".
Did you mean:
tazproperties
2010 Feb 22
1
matching on two criteria
...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)
#Creat 1st dataframe
TazProperties..<-data.frame(Props,TAZ,Area)
#Sample Data
Props2<-c("p754921","p754921","p754921","p75506" ,"p75506"
,"p75506","p75506" ,"p75508","p75508","p75508","p75508","p75508")...
2010 Feb 23
1
select row based on highest value
...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)
t <- TazProperties..
v <- aggregate(t$Area, by=list(t$TAZ,t$Props), sum)
names(v) <- c("TAZ", "Prop", "area")
a<-tapply(v$area, v$Prop, function(x) v$TAZ[which.max(x)])
"a" returns:
p754921 p75506 p755...