try this:
mat <- matrix(rnorm(12*3), 3)
n <- nrow(mat)
p <- ncol(mat)
ind <- rep(1:4, each = n*p/4)
lapply(split(mat, ind), matrix, nrow = n)
I hope it helps.
Best,
Dimitris
Ron Michael wrote:
Hello everyone,
Â
I have a matrix like :
Â
mat <- matrix(rnorm(12*3), 3)
Â
Now I want to brea
Try this:
lapply(split(as.data.frame(t(mat)), rep(1:(ncol(mat)/3), each = 3)), t)
On Wed, Oct 22, 2008 at 8:56 AM, Ron Michael <[EMAIL PROTECTED]>wrote:
> Hello everyone,
> Â
> I have a matrix like :
> Â
> mat <- matrix(rnorm(12*3), 3)
> Â
> Now I want to break that matrix in 4 parts each of th
Hello everyone,
Â
I have a matrix like :
Â
mat <- matrix(rnorm(12*3), 3)
Â
Now I want to break that matrix in 4 parts each of them are matrix of (3x3) and
put those 4 matrices in a "list" object of length 4
Â
Can anyone please tell me how to do that?
Get your new Email address!
Grab t
3 matches
Mail list logo