Re: [R] Conversion of column matrix into a vector without duplicates

From: ONKELINX, Thierry <Thierry.ONKELINX_at_inbo.be>
Date: Wed 24 Jan 2007 - 13:24:51 GMT


?unique

unique(A[, 2])



ir. Thierry Onkelinx

Instituut voor natuur- en bosonderzoek / Reseach Institute for Nature and Forest

Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance

Gaverstraat 4

9500 Geraardsbergen

Belgium

tel. + 32 54/436 185

Thierry.Onkelinx@inbo.be

www.inbo.be  

Do not put your faith in what statistics say until you have carefully considered what they do not say. ~William W. Watt

A statistical analysis, properly conducted, is a delicate dissection of uncertainties, a surgery of suppositions. ~M.J.Moroney

-----Oorspronkelijk bericht-----
Van: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] Namens Shubha Vishwanath
Karanth
Verzonden: woensdag 24 januari 2007 14:13 Aan: r-help@stat.math.ethz.ch
Onderwerp: [R] Conversion of column matrix into a vector without duplicates

Hi R,  

I have a matrix A,  

A=

      [,1] [,2]

[1,] a u

[2,] b v

[3,] c x

[4,] d x

[5,] e x
 

I want to put the 2nd column of this matrix in a vector without duplicates. i.e., my vector v should be (u, v, x), whose length is 3.  

Can anybody help me on this?  

Thanks in advance

Shubha.

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Jan 25 00:54:38 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 24 Jan 2007 - 14:00:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.