Hi Farnoosh, you can use unique in the R-base or distinct from the dplyr library.
Best Ulrik On Tue, 15 Nov 2016 at 06:59 Farnoosh Sheikhi via R-help < r-help@r-project.org> wrote: > Hi, > I have a data set like below: > Subject<- c("2", "2", "2", "3", "3", "3", "4", "4", "5", "5", "5", > "5")dates<-c("2011-01-01", "2011-01-01", "2011-01-03" ,"2011-01-04", > "2011-01-05", "2011-01-06" ,"2011-01-07", "2011-01-07", "2011-01-09" > ,"2011-01-10" ,"2011-01-11" ,"2011-01-11")deps<-c("A", "B", "CC", > "C", "CC", "A", "F", "DD", "A", "F", "FF", "D")df <- data.frame(Subject, > dates, deps); df > I want to choose unique dates per ID in a way there are not duplicate > dates per ID. I don't mind what department to pick. I really appreciate any > help. Best,Farnoosh > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.