unlist                 package:base                 R Documentation

_F_l_a_t_t_e_n _L_i_s_t_s

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

       x: A list.

recursive: logical. Should unlisting be applied to list components of
          `x'?

use.names: logical. Should names be preserved?

_D_e_t_a_i_l_s:

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

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

_S_e_e _A_l_s_o:

     `c', `as.list'.

_E_x_a_m_p_l_e_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)

