search for: condolots_

Displaying 1 result from an estimated 1 matches for "condolots_".

2010 Feb 19
1
Subtracting one based on an If
For the following: Bldgid<-c(1000,1000,1000,1001,1002,1003,1003,1003) Maplot<-c(20000,20001,20002,30000,30001,40000,40001,40002) Area<-c(40,170,160,50,100,100,90,110) #Construct Sample dataframe MultiLotBldgs..<-data.frame(Bldgid,Maplot,Area) CondoLots_ <- tapply(MultiLotBldgs..$Maplot, MultiLotBldgs..$Bldgid, length) CondoLots_ Returns: 1000 1001 1002 1003 3 1 1 3 What i want to do is to subtract 1 from the above for all cases where there are more than one, so that CondoLots_ returns: 1000 1001 1002 1003 2 1 1 2...