Next: setodometer() Up: MacAnova Help File Previous: sethistory()   Contents

setlabels()

Usage:
setlabels(x, labels [,silent:T]), x an existing scalar, vector, matrix,
  array or structure, labels a CHARACTER scalar or vector, a structure
  with CHARACTER scalar or vector components, or NULL



Keywords: general, variables
setlabels(x, Labels) "attaches" coordinate or component labels in Labels
to variable x.  If x already has labels, they are replaced.  Labels must
a CHARACTER scalar or vector, a structure whose components are CHARACTER
scalars or vectors, or NULL.

x must be an existing scalar, vector or array of any type, or a
structure.

When Labels is NULL, any existing labels for x are removed.

When x is a vector, Labels normally is a scalar or vector of row labels
for x.  When x is a matrix or array, Labels is normally a structure with
ncomps(Labels)) = ndims(x) with Labels[I] a scalar or vector used to
label dimension I of x.

setlabels(x, Labels, silent:T) does the same, except messages
concerning a mismatch in the number of vectors of labels provided are
suppressed.

It is an error when the length of a non-scalar vector of labels for a
coordinate does not match the dimension of the coordinate.  See topic
'labels' for information on how scalar coordinate labels are
interpreted.

When Labels is a vector and ndims(x) > 1 or labels is a structure with
ndims(x) > ncomps(Labels), the missing labels are all assumed to be "@".

Conversely, when Labels is a structure and ncomps(Labels) > ndims(x),
the extra vectors of labels are ignored.

See also topics 'labels', getlabels(), haslabels().


Gary Oehlert 2003-01-15