Re: [R] Partitioning matrix

2009-06-23 Thread Kingsford Jones
see ?"[" and notice the 'drop' argument. So in your example try dat[1, , drop=FALSE] hth, Kingsford On Tue, Jun 23, 2009 at 1:13 AM, Bogaso wrote: > > Let say, I have following matrix : > > dat <- matrix(rnorm(40), 2, 20) > > Now I want to partition this like this : > > dat1 <- dat[1,] > da

Re: [R] Partitioning matrix

2009-06-23 Thread cls59
Bogaso wrote: > > Let say, I have following matrix : > > dat <- matrix(rnorm(40), 2, 20) > > Now I want to partition this like this : > > dat1 <- dat[1,] > dat2 <- dat[2,] > > But point is that, dat1 and dat2 become vector object. How can I force > them to be matrix object with dimension (1x