Next: next Up: MacAnova Help File Previous: ncomps()   Contents

ndims()

Usage:
ndims(x)



Keywords: variables, null variables
ndims(x) computes the number of dimensions of x.  If x is a vector,
ndims(x) is 1; if x is a matrix, ndims(x) is 2, even if has column
dimension 1.

If x is a NULL variable, ndims(x) is 0.

If x is a structure, ndims(x) is a structure.  If x_i is the i-th
component of x, the i-th component of ndims(x) is ndims(x_i).

Examples:
  Cmd> x <- run(7); vector(ndims(x),ndims(x'), ndims(x''))
  (1)           1           2           2

  Cmd> y <- array(run(24),1,6,1,4); ndims(y)
  (1)           4

  Cmd> ndims(structure(x,y))
  component: x
  (1)           1
  component: y
  (1)           4

See also topics length(), dim(), 'NULL'.


Gary Oehlert 2003-01-15