

unlist {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 com-
          ponents 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 infor-
     mation present in `x'.  If `use.names = FALSE' all nam-
     ing 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)

