[R] Re: <number of ties>

Torsten Hothorn Torsten.Hothorn at rzmail.uni-erlangen.de
Thu Mar 28 08:56:22 CET 2002



> 
> hi,
> 
> I would like to how to count the number of ties in a vector or matrix picking a column at a time,(ie any type of array)
> 

R> x <- c(1,1,1:10)
R> duplicated(x)
 [1] FALSE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
FALSE
R> sum(duplicated(x))
[1] 2
R> 

and apply and friends for matrices. A subject would be helpful ...

Torsten

> themba
> 
>  
> 
> 
> 
> ---------------------------------
> 


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list