\HeaderA{attr}{Object Attributes}{attr}
\aliasA{attr<\Rdash}{attr}{attr<.Rdash.}
\keyword{attribute}{attr}
\begin{Description}\relax
Get or set specific attributes of an object.
\end{Description}
\begin{Usage}
\begin{verbatim}
attr(x, which)
attr(x, which) <- value
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object whose attributes are to be accessed.
\item[\code{which}] a character string specifying which attribute is to be
accessed.
\item[\code{value}] an object, the new value of the attribute.
\end{ldescription}
\end{Arguments}
\begin{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.

The first form first looks for an exact match to \code{code} amongst the
attributed of \code{x}, then a partial match.  If no exact match is
found and more than one partial match is found, the result is \code{NULL}.
\end{Value}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{attributes}{attributes}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
# create a 2 by 5 matrix
x <- 1:10
attr(x,"dim") <- c(2, 5)
\end{ExampleCode}
\end{Examples}

