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


ncols(x) where x is a matrix or generalized matrix

Keywords: variables
ncols(x) returns the number of columns of matrix argument x.  If x has
more than two dimensions, no more than two dimensions may exceed 1 and
it is treated as described in topic 'matrices'.

If x is a structure, ncols(x) is a structure.  If xi is the i-th
component of x, the i-th component of ncols(x) is ncols(xi).

  Cmd> x <- run(7); vector(nrows(x),ncols(x),nrows(x'),ncols(x'))
  (1)           7           1           1           7

  Cmd> y <- array(run(24),1,6,1,4);vector(nrows(y),ncols(y))
  (1)           6           4

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

See also topics nrows(), dim(), ndims(), length(), 'structures'.

Gary Oehlert 2003-01-15