This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/attr.html
attr {base}R Documentation

Object Attributes

Usage

attr(obj, which)
attr(obj, which) <- value

Arguments

obj

an object whose attributes are to be accessed.

which

a character string specifying which attribute is to be accessed.

Value

This function provides access to a single object attribute. The simple form above returns the value of the named attribute. The assignment form causes the named attribute to take the value on the right of the assignment symbol.

See Also

attributes

Examples

# create a 2 by 5 matrix
x <- 1:10
attr(x,"dim") <- c(2,5)

[Package base version 0.60 ]