you need: unique(A[, 2])

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Shubha Vishwanath Karanth" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, January 24, 2007 2:12 PM
Subject: [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]]
>
> ______________________________________________
> [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
> and provide commented, minimal, self-contained, reproducible code.
> 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

______________________________________________
[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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to