Well, Rui -- I'll bet that that gobSmacked him (and probably others)!
So here's just a tiny extra effort at enlightenment.
The keys are understanding that:
1. Matrices are (formally) just 2-d arrays.
2. All arrays are just vectors, indexed in "column major" order --
i.e. rows vary the fastest, th
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
Hello,
I am having trouble creating a (1000,3,201) array in R from a data set
created within the same script. My problem is that I want to take a matrix
that is 1000x603
(called "landmat") and separate this into 201 separate (1000x3) matrices.
My problem is when I try to do particular combinatio
3 matches
Mail list logo