Re: [R] Adding columns of Aggregates to existing dataframe

2008-06-21 Thread tonyxv
Thanks. ave() is the exact function I was after. tonyxv wrote: > > Hello, > I have a dataframe > > > ID1 ID2 > A1B3 > A1B4 > A1B3 > A1B3 > A2B1 > A2B1 > A2B4 > A3B2 > A3B2 > A5B1 > A5B1 > A

[R] Re move row.names column in dataframe

2008-06-21 Thread tonyxv
Hello, aa<-c(1,1,2,2,3,3,4,4,5,5,6,6) bb<-c(56,56,33,33,53,53,20,20,63,63,9,9) cc<-data.frame(aa,bb) uniquedf <- unique(cc) View(uniquedf) Why does the column "row.names" appear in the new dataframe and how do I get rid of it. "uniquedf$row.names <- NULL" does not seem to work. For what I'

[R] Adding columns of Aggregates to existing dataframe

2008-06-20 Thread tonyxv
Hello, I have a dataframe ID1 ID2 A1B3 A1B4 A1B3 A1B3 A2B1 A2B1 A2B4 A3B2 A3B2 A5B1 A5B1 A5B6 A5B4 A6B2 I want to add extra columns to the dataframe CountID1 and CountID2 which is the actual count of values such as A1 etc ie ID1