R dim() Function: Array Dimensions Guide
In the R language, the dim() function can be used to obtain the dimensions of an array. For example, for an array arr, its dimension information can be obtained by using dim(arr). If arr is a two-dimensional array, dim(arr) will return a vector containing two elements, representing the number of rows and columns in the array. If arr is a three-dimensional array, dim(arr) will return a vector containing three elements, representing the number of rows, columns, and depth of the array. Similarly, for arrays of higher dimensions, the dim() function will return a vector containing the corresponding dimension information.