Displaying 4 results from an estimated 4 matches for "bldgid".
2009 Oct 29
5
Summing identical IDs
Hello All,
I would like to select records with identical IDs then sum an attribute
then and return them to the data frame as a single record. Please consider
Acres<-c(100,101,100,130,156,.5,293,300,.09)
Bldgid<-c(1,2,3,4,5,5,6,7,7)
DF=cbind(Acres,Bldgid)
DF<-as.data.frame(DF)
So that:
Acres Bldgid
1 100.00 1
2 101.00 2
3 100.00 3
4 130.00 4
5 156.00 5
6 0.50 5
7 293.00 6
8 300.00 7
9 0.09 7
Becomes
Acres Bldgid
1 100.00 1
2 101.00...
2010 Feb 17
1
Procedure not working for actual data
...he cases that are False in
Is$NotTooSmall. Like i said my sample data works fine but my actual
implementation does not. Any suggestions? I know this is not easy to
answer without seeing the problem but this is the best i can do without
sending you all of my data.
Cheers,
JR
#Sample data
Bldgid<-c(1000,1000,1001,1002,1003,1003)
Maplot<-c(20000,20001,30000,30001,40000,40001)
Area<-c(40,170,50,100,100,4.9)
#Construct Sample dataframe
MultiLotBldgs..<-data.frame(Bldgid,Maplot,Area)
#Get Building Areas
MultiLotBldgArea.X <- unlist(tapply(MultiLotBldgs..$Area,
MultiLotBldgs..$Bl...
2010 Jan 12
5
Drop last numeral
...ta are of varying lengths it doenst work so well
Data<-c("1131", "1132", "1731" ,"1732" ,"1821" ,"1822", "2221" ,"2222",
"2241" ,"2242","414342" ,"414371" ,"414372")
Bldgid<-substring(as.character(Data),1,3)
returns:
"113" "113" "173" "173" "182" "182" "222" "222" "224" "224" "414" "414"
"414"
but i want"
"113", "1...
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..$B...