ndims {pracma} | R Documentation |
Number of matrix or array dimensions.
ndims(x)
x |
a vector, matrix, array, or list |
Returns the number of dimensions as length(x)
.
A vector is seen as a matrix with one row, i.e. for a vector the number of dimensions is 2.
the number of dimensions in the vector or array x
.
The result will differ from Matlab when x
is a character vector.
ndims(1:8) ndims(array(1:8, c(2,2,2)))