Re: [R] how to seperate a matrix

2009-12-04 Thread aegea
Thanks a lot, Jorge. It works well! On Fri, Dec 4, 2009 at 12:00 AM, Jorge Ivan Velez [via R] < ml-node+948277-873392...@n4.nabble.com > wrote: > Hi aegea, > > Here is one: > > m <- structure(c(6, 5, 20, 7, 8, 25, 14, 8, 9, 10, 11, 12, 13, 14, > 1, 2, 3, 4, 5, 6, 7), .Dim = c(7L, 3L)) > > m1 <-

Re: [R] how to seperate a matrix

2009-12-03 Thread Jorge Ivan Velez
Hi aegea, Here is one: m <- structure(c(6, 5, 20, 7, 8, 25, 14, 8, 9, 10, 11, 12, 13, 14, 1, 2, 3, 4, 5, 6, 7), .Dim = c(7L, 3L)) m1 <- m[m[,1] >= m[,2], ] m1 m2 <- m[m[,1] < m[,2], ] m2 Best, Jorge On Thu, Dec 3, 2009 at 10:12 PM, aegea <> wrote: > > Hello, > > I am working on seperate the

Re: [R] how to seperate a matrix

2009-12-03 Thread milton ruser
Hi there, mymat<-matrix(c(6,8,1, 5,9,2, 20,10,3, 7,11,4, 8,12,5, 25,13,6, 14,14,7), byrow=T, ncol=3) mymat1<-mymat[mymat[,1]=mymat[,2],] mymat2 bests milton On Thu, Dec 3, 2009 at 10:12 PM, aegea wrote: > > Hello, > > I am working on seperate the matrix to two matrices but got trouble on > do

[R] how to seperate a matrix

2009-12-03 Thread aegea
Hello, I am working on seperate the matrix to two matrices but got trouble on doing it. Please give me some suggestions on doing this. Thanks a lot! My original matrix m is as follows for example, [,1] [,2] [,3] [1,]681 [2,]592 [3,]20 103 [4,]