strtrim                 package:base                 R Documentation

_T_r_i_m _C_h_a_r_a_c_t_e_r _S_t_r_i_n_g_s _t_o _S_p_e_c_i_f_i_e_d _W_i_d_t_h_s

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

     Trim character strings to specified display widths.

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

     strtrim(x, width)

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

       x: a character vector, or an object which can be coerced to a
          character vector by 'as.character'.

   width: Positive integer values: recycled to the length of 'x'.

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

     'Width' is interpreted as the display width in a monospaced font. 
     What happens with non-printable characters (such as backspace,
     tab) is implementation-dependent and may depend on the locale
     (e.g. they may be included in the count or they may be omitted).

     Using this function rather than 'substr' is important when there
     might be double-width characters in character vectors

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

     A character vector of the same length and with the same attributes
     as 'x' (after possible coercion).

     Elements of the result will be have the encoding declared as that
     of the current locale (see 'Encoding' if the corresponding input
     had a declared encoding and the current locale is either Latin-1
     or UTF-8.

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

     strtrim(c("abcdef", "abcdef", "abcdef"), c(1,5,10))

