I would like to create a 3D array based on a couple of 2D matrices in R, but I have no idea. Let's say we have the following three matrices:
matrix1 <- matrix(1:1, nrow = 5, ncol = 5)
matrix2 <- matrix(2:2, nrow = 5, ncol = 5)
matrix3 <- matrix(3:3, nrow = 5, ncol = 5)
I would like to know how to create one [1:3, 1:5, 1:5] array, as a combination of the three matrices. Thank you!