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)

