Re: [R] block matrices

2010-02-26 Thread Gustave Lefou
Thank you Duncan, Kjetil and William. Kjetil, with rep(0,2), I get a vector. So I have to transpose it. cbind(A,B, t( rep(0,2) ) ) if C is of length 2. Is that right ? I like very much Duncan's general solution. Thanks a lot, Gustave 2010/2/24 Kjetil Halvorsen > see below. > > On Wed, Feb 24

Re: [R] block matrices

2010-02-24 Thread Duncan Murdoch
On 24/02/2010 10:56 AM, Gustave Lefou wrote: Dear all, I do not know how to deal with block matrices in R. For example I have 3 matrices A, B and C. And I want to produce a new matrix of this form ( A B 0 ) ( 0 0 C ) where A, B and C are one-row matrices. The problem is that mathematica

Re: [R] block matrices

2010-02-24 Thread William Revelle
At 1:06 PM -0300 2/24/10, Kjetil Halvorsen wrote: see below. On Wed, Feb 24, 2010 at 12:56 PM, Gustave Lefou wrote: Dear all, I do not know how to deal with block matrices in R. For example I have 3 matrices A, B and C. And I want to produce a new matrix of this form ( A B 0 ) ( 0 0

Re: [R] block matrices

2010-02-24 Thread Kjetil Halvorsen
see below. On Wed, Feb 24, 2010 at 12:56 PM, Gustave Lefou wrote: > Dear all, > > I do not know how to deal with block matrices in R. > > For example I have 3 matrices A, B and C. > > And I want to produce a new matrix of this form > > ( A B 0 ) > ( 0 0 C ) > > where A, B and C are one-row matric

[R] block matrices

2010-02-24 Thread Gustave Lefou
Dear all, I do not know how to deal with block matrices in R. For example I have 3 matrices A, B and C. And I want to produce a new matrix of this form ( A B 0 ) ( 0 0 C ) where A, B and C are one-row matrices. Apart from A, B and C, all the coefficients are 0. Is there an easy solution in R