Well, you can either store arrays in a list or in an array.
With the array the idea would be to use a three-dimensional array. The third dimension would be an index of the matrices. However, for this solution, all matrices must be equal in size.
For example, the following command generates an array that can be interpreted as the following: it stores 10 2 x 2 arrays.
matrizes <- array(dim= c(2,2,10))
Then you can populate this array by indexing the third dimension:
set.seed(1)
for (i in 1:10){
matrizes[,,i] <- matrix(rnorm(4), ncol=2)
}
So, to access the first array:
matrizes[,,1]
[,1] [,2]
[1,] -0.6264538 -0.8356286
[2,] 0.1836433 1.5952808
or the tenth array
matrizes[,,10]
[,1] [,2]
[1,] -0.3942900 1.1000254
[2,] -0.0593134 0.7631757
The other option is as you yourself said, store in a list. Lists are very flexible in R, so if you want to store other objects together with the arrays, or if the arrays are of different sizes, the list is more appropriate.
matrizes <- list()
set.seed(1)
for (i in 1:10){
matrizes[[i]] <- matrix(rnorm(4), ncol=2)
}
Accessing array 1:
matrizes[[1]]
[,1] [,2]
[1,] -0.6264538 -0.8356286
[2,] 0.1836433 1.5952808
And the array 10:
matrizes[[10]]
[,1] [,2]
[1,] -0.3942900 1.1000254
[2,] -0.0593134 0.7631757