my question might sound trivial to quite a lot of you, but after a long internet search I still don't have an answer to the following question:
How to convert a three dimensional array to a "three dimensional" list?
Suppose I have the following:
A1 <- matrix(runif(12),4,3)
A2 <- matrix(runif(12),4,3)
A3 <- matrix(runif(12),4,3)
MyList <- list(A1,A2,A3)
MyArray <- array(NA,c(4,3,3))
MyArray[,,1] <- A1
MyArray[,,2] <- A2
MyArray[,,3] <- A3
Is there a way to convert MyArray
into a list with "the same structure" as MyList
?
Thank you very much for your help!
Best, Romain
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…