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

