Re: [R] partial duplicates of dataframe rows, indexing and removal

2011-12-08 Thread Jean V Adams
Try this: df[!duplicated(df[, 1:3]), ] Jean Dgnn wrote on 12/07/2011 08:24:01 PM: > Hello. I am trying to remove from my dataframe, those rows in which the first > 7 columns are duplicated even if subsequent columns make those rows unique. > > df<-data.frame(id=rep(c('amy','bob','joe') , e

[R] partial duplicates of dataframe rows, indexing and removal

2011-12-07 Thread Dgnn
Hello. I am trying to remove from my dataframe, those rows in which the first 7 columns are duplicated even if subsequent columns make those rows unique. df<-data.frame(id=rep(c('amy','bob','joe') , each=5), pet1=sample(LETTERS[1:3],15, replace=T), pet2=sample(LETTERS[1:3],15, replace=T),