\Header{unlist}{Flatten Lists}
\keyword{list}{unlist}
\keyword{manip}{unlist}
\begin{Usage}
\begin{verbatim}
unlist(x, recursive=TRUE, use.names=TRUE)
\end{verbatim}
\end{Usage}
\begin{Description}
Given a list structure \texttt{x}, \texttt{unlist}
produces a vector which contains all the atomic components
which occur in \texttt{x}.
If \texttt{recursive=FALSE}, the function will not
recurse beyond the first level items in \texttt{x}.

By default, \texttt{unlist} tries to retain the naming
information present in \texttt{x}.
If \texttt{use.names=FALSE} all naming information is dropped.\end{Description}
\begin{SeeAlso}
\texttt{\Link{c}}, \texttt{\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}

