In most iterative algorithms, only the current resutls and maybe the last results need to be stored. So, there is rarely any use to store every thing. However, if you indeed need that, multi-dimensional arrays are a convenient choice. E.g.,
(A=array(1:16, dim=c(2,2,4)))
</p>