home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / nchar < prev    next >
Encoding:
Text File  |  1997-04-23  |  735 b   |  28 lines

  1.     
  2.     _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
  3.     
  4.          nchar(x)
  5.     
  6.     _D_e_s_c_r_i_p_t_i_o_n:
  7.     
  8.          nchar takes a character vector as an argument and
  9.          returns a vector whose elements contain the number of
  10.          characters in the corresponding element of x.  It only
  11.          accepts character vectors as arguments if you want to
  12.          operate on other objects passing them through deparse
  13.          first will be required.
  14.     
  15.     _S_e_e _A_l_s_o:
  16.     
  17.          paste, substr, strsplit
  18.     
  19.     _E_x_a_m_p_l_e_s:
  20.     
  21.          x<-c("asfef","qwerty","yuiop[","b","stuff.blah.yech")
  22.          nchar(x)
  23.          # 5  6  6  1 15
  24.     
  25.          nchar(deparse(mean))
  26.          # 23  1 16 45 11 64  2 17 50 43  2 17  1
  27.     
  28.