

setNames {nls}                               R Documentation

_S_e_t _t_h_e _N_a_m_e_s _i_n _a_n _O_b_j_e_c_t

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

     This is a convenience function that sets the names on
     an object and returns the object.  It is most useful at
     the end of a function definition where one is creating
     the object to be returned and would prefer not to store
     it under a name just so the names can be assigned.

_U_s_a_g_e_:

     setNames(object, nm)

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

  object: an object for which a `names' attribute will be
          meaningful

      nm: a character vector of names to assign to the
          object

_V_a_l_u_e_:

     An object of the same sort as `object' with the new
     names assigned.

_A_u_t_h_o_r_(_s_)_:

     Douglas M. Bates and Saikat DebRoy

_S_e_e _A_l_s_o_:

     `clearNames'

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

     library( nls )
     setNames( 1:3, c("foo", "bar", "baz") )
     # this is just a short form of
     tmp <- 1:3
     names(tmp) <-  c("foo", "bar", "baz")
     tmp

