[R] how to get unique vectors

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Dec 19 23:17:49 CET 2001


On Wed, 19 Dec 2001, Jason Liao wrote:

> First, happy holidays, everyone! Thanks to the R team for bringing out
> 1.4 before the new year.
>
> I have 10000 integer triplets stored in A[1:10000, 1:3]. I would like
> to find the unique triplets among the 10000 ones with possible
> duplications. What is the easiest way for this. I know the function
> unique(), which apply to a vector, not the 10000*3 array in my problem.

Well, new in 1.4.0 is unique.data.frame(), so you could either use that or
copy its idea.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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