Rev 7002 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{unlist}\title{Flatten Lists}\usage{unlist(x, recursive = TRUE, use.names = TRUE)}\alias{unlist}\arguments{\item{x}{A list.}\item{recursive}{logical. Should unlisting be applied to listcomponents of \code{x}?}\item{use.names}{logical. Should names be preserved?}}\description{Given a list structure \code{x}, \code{unlist}produces a vector which contains all the atomic componentswhich occur in \code{x}.}\details{If \code{recursive=FALSE}, the function will notrecurse beyond the first level items in \code{x}.By default, \code{unlist} tries to retain the naminginformation present in \code{x}.If \code{use.names = FALSE} all naming information is dropped.}\seealso{\code{\link{c}}, \code{\link{as.list}}.}\examples{unlist(options())unlist(unlist(options(), use.names=F))# works for vectors or listsl.ex <- list(a = list(1:5, LETTERS[1:5]), b = "Z", c = NA)unlist(l.ex, rec = F)unlist(l.ex, rec = T)}\keyword{list}\keyword{manip}