Re: [R] rearrange data columns

2007-10-11 Thread Gabor Grothendieck
Try this: matrix(rbind(a, b), nrow(a)) On 10/11/07, Martin Ivanov <[EMAIL PROTECTED]> wrote: > Dear R users, > I need to to the the following. Let a= 1 2 3 > 4 5 6 > and b= -1 -2 -3 be (2x3) matrices. >-4 -5 -6 > I need to combine the two ma

Re: [R] rearrange data columns

2007-10-11 Thread Ted Harding
On 11-Oct-07 12:09:19, Robin Hankin wrote: > > On 11 Oct 2007, at 12:55, Martin Ivanov wrote: > >> Dear R users, >> I need to to the the following. Let a= 1 2 3 >> 4 5 6 >> and b= -1 -2 -3 be (2x3) matrices. >> -4 -5 -6 >> I need to combine the

Re: [R] rearrange data columns

2007-10-11 Thread Henrique Dallazuanna
Try this also: ab <- do.call("cbind", list(a, b))[,c(1,4,2,5,3,6)] On 11/10/2007, Martin Ivanov <[EMAIL PROTECTED]> wrote: > > Dear R users, > I need to to the the following. Let a= 1 2 3 > 4 5 6 > and b= -1 -2 -3 be (2x3) matrices. >-4 -5 -6 > I

Re: [R] rearrange data columns

2007-10-11 Thread Douglas Bates
On 10/11/07, Martin Ivanov <[EMAIL PROTECTED]> wrote: > Dear R users, > I need to to the the following. Let a= 1 2 3 > 4 5 6 > and b= -1 -2 -3 be (2x3) matrices. > -4 -5 -6 > I need to combine the two matrices into a new (2x6) matrix like this: >

Re: [R] rearrange data columns

2007-10-11 Thread Peter Dalgaard
Martin Ivanov wrote: > Dear R users, > I need to to the the following. Let a= 1 2 3 > 4 5 6 > and b= -1 -2 -3 be (2x3) matrices. > -4 -5 -6 > I need to combine the two matrices into a new (2x6) matrix like this: > > ab = ( 1 -1 2 -2 3 -3

Re: [R] rearrange data columns

2007-10-11 Thread Robin Hankin
On 11 Oct 2007, at 12:55, Martin Ivanov wrote: > Dear R users, > I need to to the the following. Let a= 1 2 3 > 4 5 6 > and b= -1 -2 -3 be (2x3) matrices. > -4 -5 -6 > I need to combine the two matrices into a new (2x6) matrix like this: > > a

[R] rearrange data columns

2007-10-11 Thread Martin Ivanov
Dear R users, I need to to the the following. Let a= 1 2 3 4 5 6 and b= -1 -2 -3 be (2x3) matrices. -4 -5 -6 I need to combine the two matrices into a new (2x6) matrix like this: ab = ( 1 -1 2 -2 3 -3 ) 4 -4 5 -5 6 -6 How can