namedrop                package:bbmle                R Documentation

_d_r_o_p _u_n_n_e_e_d_e_d _n_a_m_e_s _f_r_o_m _l_i_s_t _e_l_e_m_e_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     goes through a list (containing a combination of single- and
     multiple-element vectors) and removes redundant names that will
     make trouble for mle

_U_s_a_g_e:

     namedrop(x)

_A_r_g_u_m_e_n_t_s:

       x: a list of named or unnamed, typically numeric, vectors

_D_e_t_a_i_l_s:

     examines each element of 'x'.  If the element has length one and
     is a named vector, the name is removed; if 'length(x)' is greater
     than 1, but all the names are the same, the vector is renamed

_V_a_l_u_e:

     the original list, with names removed/added

_A_u_t_h_o_r(_s):

     Ben Bolker

_E_x_a_m_p_l_e_s:

     x = list(a=c(a=1),b=c(d=1,d=2),c=c(a=1,b=2,c=3))
     names(unlist(namedrop(x)))
     names(unlist(namedrop(x)))

