\Header{attributes}{Object Attribute Lists}
\alias{attributes<\Rdash}{attributes}
\alias{mostattributes<\Rdash}{attributes}
\keyword{attribute}{attributes}
\begin{Description}\relax
These functions access an object's attribute list.
The first form above returns the an object's attribute list.
The assignment forms make the list on the right-hand
side of the assignment the object's attribute list (if appropriate).\end{Description}
\begin{Usage}
\begin{verbatim}
attributes(obj)
attributes(obj) <- value
mostattributes(obj) <- value
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{obj}] an object
\item[\code{value}] an appropriate attribute list, or \code{NULL}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The \code{mostattributes} assignment takes special care for the
\code{\Link{dim}}, \code{\Link{names}} and \code{\Link{dimnames}}
attributes, and assigns them only when that is valid whereas as
\code{attributes} assignment would give an error in that case.\end{Details}
\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{\Link{attr}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
x <- cbind(a=1:3, pi=pi) # simple matrix w/ dimnames
str(attributes(x))

## strip an object's attributes:
attributes(x) <- NULL
x # now just a vector of length 6

mostattributes(x) <- list(mycomment = "really special", dim = 3:2,
   dimnames = list(LETTERS[1:3], letters[1:5]), names = paste(1:6))
x # dim(), but not {dim}names
\end{ExampleCode}
\end{Examples}

