October 2017
Beginner to intermediate
236 pages
7h 38m
English
To work in an array, you have to understand how the dimension works. The first and second dimensions in the preceding example specify the dimension of the matrices. Each matrix is element of this array. The third dimension specifies the element number of the array. So, to extract any matrix from this array, you have to specify the position of that matrix by providing the position index using the third dimension. For example, to extract the second matrix from the arrayA object, execute the following code:
arrayA2 <- arrayA[, , 2]
Since the value for the first and second dimensions is blank, it indicates that all of the elements have to be extracted in that direction. So, in this case, it will extract all rows and all columns ...