\Header{unlist}{Flatten Lists}
\keyword{list}{unlist}
\keyword{manip}{unlist}
\begin{Description}\relax
Given a list structure \code{x}, \code{unlist}
produces a vector which contains all the atomic components
which occur in \code{x}.\end{Description}
\begin{Usage}
\begin{verbatim}
unlist(x, recursive = TRUE, use.names = TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] A list.
\item[\code{recursive}] logical. Should unlisting be applied to list
components of \code{x}?
\item[\code{use.names}] logical. Should names be preserved?
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If \code{recursive=FALSE}, the function will not
recurse beyond the first level items in \code{x}.

By default, \code{unlist} tries to retain the naming
information present in \code{x}.
If \code{use.names = FALSE} all naming information is dropped.\end{Details}
\begin{SeeAlso}\relax
\code{\Link{c}}, \code{\Link{as.list}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
unlist(options())
unlist(unlist(options(), use.names=F))# works for vectors or lists
l.ex <- list(a = list(1:5, LETTERS[1:5]), b = "Z", c = NA)
unlist(l.ex, rec = F)
unlist(l.ex, rec = T)
\end{ExampleCode}
\end{Examples}

