DIM()
Returns the number of dimensions, or 1 for an atomic vector.
ndim(x)
x
a matrix or atomic vector