search for: pairiddup

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

Did you mean: pairiddups
2012 Sep 27
3
Keep rows in a dataset if one value in a column is duplicated
...keep the pair observations, and was using the code below until it gave me the error " $ operator is invalid for atomic vectors". I am just beginning to learn R, so I apologize if the code is really rough. Basically I want to keep all the rows in the data set for which the value of "Pairiddups" is TRUE. How do I do it? And how do I get past the error? Thank you so much, Diana PairID<-c(Health2$pairid) duplicated(PairID, incomparables=TRUE, fromLast=TRUE) PairIDdup=duplicated(PairID) cbind(PairID, PairIDdup) PairID[which(PairIDdup)] PairIDDuplicates<-PairID%in%PairID[whic...