toString                package:base                R Documentation

_C_o_n_v_e_r_t _a_n _R _O_b_j_e_c_t _t_o _a _C_h_a_r_a_c_t_e_r _S_t_r_i_n_g

_D_e_s_c_r_i_p_t_i_o_n:

     This is a helper function for 'format' to produce a single
     character string describing an R object.

_U_s_a_g_e:

     toString(x, ...)

     ## Default S3 method:
     toString(x, width = NULL, ...)

_A_r_g_u_m_e_n_t_s:

       x: The object to be converted.

   width: Suggestion for the maximum field width.  Values of 'NULL' or
          '0' indicate no maximum. The minimum value accepted is 6 and
          smaller values are taken as 6.

     ...: Optional arguments passed to or from methods.

_D_e_t_a_i_l_s:

     This is a generic function for which methods can be written: only
     the default method is described here.  Most methods should honor
     the 'width' argument to specify the maximum display width (as
     measured by 'nchar(type = "width"') of the result.

     The default method first converts 'x' to character and then
     concatenates the elements separated by '", "'. If 'width' is
     supplied and is not 'NULL', the default method returns the first
     'width - 4' characters of the result with '....' appended, if the
     full result would use more than 'width' characters.

_V_a_l_u_e:

     A character vector of length 1 is returned.

_A_u_t_h_o_r(_s):

     Robert Gentleman

_S_e_e _A_l_s_o:

     'format'

_E_x_a_m_p_l_e_s:

     x <- c("a", "b", "aaaaaaaaaaa")
     toString(x)
     toString(x, width=8)

