Skip to content
Prev 305446 / 398506 Next

problem creating an array

Hello,

You don't need the loop, it can be done with one much simpler instruction.
Since the number of rows is not important, the example uses a 10x603 matrix.

x <- matrix(seq_len(10*603), ncol = 603)
y <- array(x, dim = c(10, 3, 201))  # that's it

# See the first two
y[, , 1:2]

Hope this helps,

Rui Barradas
Em 13-09-2012 23:04, Curtis Burkhalter escreveu: