An array is a way to organize data of the same type in more than two dimensions. An array could be of any dimension, and the data type must be the same in each of the array elements. A matrix is a special case of an array with only two dimensions. In this recipe, you will learn how to create an array and how to access its elements.
Suppose you are in a situation where you must store a series of matrices into a single R object and then perform analysis based on that; however, in this case, this is the perfect and efficient way to create an array. For example, you are in a situation to store four matrices of 2 x 2 order.