

   unlist {base}                                R Documentation

   FFllaatttteenn LLiissttss

   DDeessccrriippttiioonn::

        Given a list structure `x', `unlist' produces a vector
        which contains all the atomic components which occur in
        `x'.

   UUssaaggee::

        unlist(x, recursive = TRUE, use.names = TRUE)

   AArrgguummeennttss::

          x: A list.

   recursive: logical. Should unlisting be applied to list com-
             ponents of `x'?

   use.names: logical. Should names be preserved?

   DDeettaaiillss::

        If `recursive=FALSE', the function will not recurse
        beyond the first level items in `x'.

        By default, `unlist' tries to retain the naming infor-
        mation present in `x'.  If `use.names = FALSE' all nam-
        ing information is dropped.

   SSeeee AAllssoo::

        `c', `as.list'.

   EExxaammpplleess::

        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)

