Labels for Printing or Plotting - Generic function
DESCRIPTION:
Returns a vector of character strings or some other object which can
be used to label the object.
These functions are generic (see Methods);
method functions can be written to handle specific classes of data.
Classes that already have methods for
labels are
lm,
bdLm,
model.matrix,
terms, and
tree.
USAGE:
labels(object)
plotlabels(object)
REQUIRED ARGUMENTS:
object
any object, for which a printing or plotting method, or similar function,
is to be called.
VALUE:
a character vector or other suitable structure containing the necessary
character strings for labeling the data in
object.
The labels returned by
plotlabels are short: suitable for
labeling points on a scatter plot, and so on. Labels returned by
labels are suitable for labeling individual elements, columns, and so on, in printed output.
Plotting labels are based on the notion that the elements of the
object or pairs of elements from two objects are being plotted; therefore,
plotlabels usually returns a character vector.
Printing labels vary according to the class of the object, but
typically are either a character vector or a list (like a
dimnames
attribute), as appropriate.
SEE ALSO:
,
.
EXAMPLES:
x <- c("a","b","c")
cat("Results were:\\n")
cat(paste(labels(x), "=", x), "\\n")