[R] make one matirx in list after removing duplicated rows

kathie kathryn.lord2000 at gmail.com
Wed Jul 29 00:21:01 CEST 2009


Dear R users... 


I have a list, "z", below.


z<-list(matrix(c(11,11,9,0,0,0),3,2),matrix(c(10,10,10,1,1,1),3,2),
        matrix(c(7,10,1,1),2,2))

> z
[[1]]
     [,1] [,2]
[1,]   11    0
[2,]   11    0
[3,]    9    0

[[2]]
     [,1] [,2]
[1,]   10    1
[2,]   10    1
[3,]   10    1

[[3]]
     [,1] [,2]
[1,]    7    1
[2,]   10    1


>From the list, I need to remove duplicated rows based on the 1st column in
each "z" element, and then eventually make one matrix as followings;

     [,1] [,2]
[1,]   11    0      <---- from z[1]
[2,]    9    0       <---- from z[1]
[3,]   10    1      <---- from z[2]
[4,]    7    1      <---- from z[3]
[5,]   10    1      <---- from z[3]

Any comments will be greatly appreciated. 

Regards,

Kathyrn Lord



-- 
View this message in context: http://www.nabble.com/make-one-matirx-in-list-after-removing-duplicated-rows-tp24708937p24708937.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list