\Header{dimnames}{Dimnames of an Object}
\alias{dimnames$\leftarrow $}{dimnames}
\alias{dimnames.data.frame}{dimnames}
\alias{dimnames$\leftarrow $.data.frame}{dimnames}
\keyword{array}{dimnames}
\keyword{manip}{dimnames}
\begin{Usage}
\begin{verbatim}
dimnames(x)
dimnames(x) <- nlist
\end{verbatim}
\end{Usage}
\begin{Description}
Retrieve or set the dimnames of an object.\end{Description}
\begin{Details}
The functions \texttt{dimnames} and \texttt{dimnames<-} are generic.

For an \texttt{\Link{array}} (and hence in particular, for a
\texttt{\Link{matrix}}), they retrieve or
set the \texttt{dimnames} attribute (see \link{attributes}) of the object.

Both have methods for data frames.  The dimnames of a data frame are
its \texttt{row.names} attribute and its \texttt{\Link{names}}.\end{Details}
\begin{SeeAlso}
\texttt{\Link{rownames}}, \texttt{\Link{colnames}};
\texttt{\Link{array}}, \texttt{\Link{matrix}}, \texttt{\Link{data.frame}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## simple versions of rownames and colnames
## could be defined as follows
rownames0 <- function(x) dimnames(x)[[1]]
colnames0 <- function(x) dimnames(x)[[2]]
\end{ExampleCode}
\end{Examples}

