Skip to content

stuck with repeated values

2 messages · SOUVIK BANDYOPADHYAY, Chuck Cleland

#
On 12/3/2008 6:32 AM, SOUVIK BANDYOPADHYAY wrote:
x <- c("a","a","b","a","b","c","d")

duplicated(x)
[1] FALSE  TRUE FALSE  TRUE  TRUE FALSE FALSE

x %in% x[duplicated(x)]
[1]  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE

which(x %in% x[duplicated(x)])
[1] 1 2 3 4 5

?duplicated