\Header{setNames}{Set the Names in an Object}
\keyword{list}{setNames}
\begin{Description}\relax
This is a convenience function that sets the names on an object and
returns the object.  It is most useful at the end of a function
definition where one is creating the object to be returned and would
prefer not to store it under a name just so the names can be assigned.\end{Description}
\begin{Usage}
\begin{verbatim}
setNames(object, nm)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object for which a \code{names} attribute will be meaningful 
\item[\code{nm}] a character vector of names to assign to the object
\end{ldescription}
\end{Arguments}
\begin{Value}
An object of the same sort as \code{object} with the new names assigned.\end{Value}
\begin{Author}\relax
Douglas M. Bates and Saikat DebRoy\end{Author}
\begin{SeeAlso}\relax
\code{\Link{clearNames}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
setNames( 1:3, c("foo", "bar", "baz") )
# this is just a short form of
tmp <- 1:3
names(tmp) <-  c("foo", "bar", "baz")
tmp
\end{ExampleCode}
\end{Examples}

