swh:1:snp:1d6f9c912933e835b749aef1f8077112982fe84e
Raw File
Tip revision: a9b4d5f19cb88cd9d0d31fdde0d654737327d085 authored by HwB on 15 April 2012, 00:00:00 UTC
version 1.0.5
Tip revision: a9b4d5f
ndims.Rd
\name{ndims}
\alias{ndims}
\title{Number of Dimensions}
\description{
  Number of matrix or array dimensions.
}
\usage{
ndims(x)
}
\arguments{
  \item{x}{a vector, matrix, array, or list}
}
\details{
  Returns the number of dimensions as \code{length(x)}.

  A vector is seen as a matrix with one row,
  i.e. for a vector the number of dimensions is 2.
}
\value{
  the number of dimensions in the vector or array \code{x}.
}
\seealso{
  \code{\link{size}}
}
\note{
  The result will differ from Matlab when \code{x} is a character vector.
}
\examples{
ndims(1:8)
ndims(array(1:8, c(2,2,2)))
}
\keyword{array}

back to top