I need to make a matrix in R
with its elements are from matrices I defined before.
For example, I have 4 matrices,
w <- matrix(c(1,2,3,4),2,2)
x <- matrix(c(5,6,7,8),2,2)
y <- matrix(c(9,10,11,12),2,2)
z <- matrix(c(13,14,15,16),2,2)
Then, the new matrix should be a 4X4
matrix with w
is an [1:2,1:2]
element, x
is an [1:2,3:4]
element, y
is an [3:4,1:2]
element, and z
is an [3:4,3:4]
element.
How can I do that quickly?