Re: [R] Building an array from matrix blocks

2011-02-21 Thread Eduardo de Oliveira Horta
-p-1+i),i:(n-p-1+i)])) > > I imagine someone can be even more eleganter than this. > > rad > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Eduardo de Oliveira Horta > Sent: Saturday, February 19, 2011 9:

Re: [R] Building an array from matrix blocks

2011-02-21 Thread rex.dwyer
rad -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Eduardo de Oliveira Horta Sent: Saturday, February 19, 2011 9:49 AM To: r-help Subject: [R] Building an array from matrix blocks Hello, I've googled for a while and couldn't

[R] Building an array from matrix blocks

2011-02-19 Thread Eduardo de Oliveira Horta
Hello, I've googled for a while and couldn't find anything on this topic: say I have a matrix A and want to build matrices B1, B2,... using blocks from A (or equivalently an array B with B[,,i] being a block from A), and that I must sum the B[,,i]'s. I've come up with this rather non-elegant code