It worked, thank you Jim
Erik
--
View this message in context:
http://r.789695.n4.nabble.com/Keep-ALL-duplicate-records-tp3865136p3867709.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.et
Here is a function I use to find all duplicate records
> allDup <- function (value)
{
duplicated(value) | duplicated(value, fromLast = TRUE)
}
> x
IDOS time
1 userA Win 12:22
2 userB OSX 23:22
3 userA Win 04:44
4 userC Win64 12:28
> x[allDup(x$ID),]
ID OS time
1 userA Wi
Erik Svensson wrote:
>
> Hello,
> In a data frame I want to identify ALL duplicate IDs in the example to be
> able to examine "OS" and "time".
>
> (df<-data.frame(ID=c("userA", "userB", "userA", "userC"),
> OS=c("Win","OSX","Win", "Win64"),
> time=c("12:22","23:22","04:44","12:28")))
>
>
3 matches
Mail list logo