table will probably do. The following is probably is what you want:
> a <- c(1,1,2,2,3,4,5)
> a.tab <- table (a)
> a.tab
a
1 2 3 4 5
2 2 1 1 1
> as.vector(which (a.tab == 1)) [1] 3 4 5
Cheers, Yu
Jun Ding wrote:
Hi,
I am just wondering if there is an easy way to count
in a numeric vector how many numbers don't have
replicates. For example, a=c(1,1,2,2,3,4,5), how can I know there are three
numbers (3, 4 and 5) without replicates?
Thank you!
Jun
=====
______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
