nchar                  package:base                  R Documentation

_C_o_u_n_t _t_h_e _N_u_m_b_e_r _o_f _C_h_a_r_a_c_t_e_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     'nchar' takes a character vector as an argument and returns a
     vector whose elements contain the number of characters in the
     corresponding element of 'x'.

_U_s_a_g_e:

     nchar(x)

_A_r_g_u_m_e_n_t_s:

       x: character vector, or a vector to be coerced to a character
          vector.

_D_e_t_a_i_l_s:

     The internal equivalent of 'as.character' is performed on 'x'. If
     you want to operate on non-vector objects passing them through
     'deparse' first will be required.

_V_a_l_u_e:

     The number of characters as the string will be printed (integer
     '2' for a missing string).

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'strwidth' giving width of strings for plotting; 'paste',
     'substr', 'strsplit'

_E_x_a_m_p_l_e_s:

     x <- c("asfef","qwerty","yuiop[","b","stuff.blah.yech")
     nchar(x)
     # 5  6  6  1 15

     nchar(deparse(mean))
     # 23  1 16 45 11 64  2 17 50 43  2 17  1

