

_E_x_t_r_a_c_t _S_u_b_s_t_r_i_n_g_s _f_r_o_m _a _C_h_a_r_a_c_t_e_r _V_e_c_t_o_r

     substr(x, start, stop)
     substring(text, first, last = 1000000)

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

     `substr' takes a character vector as an argument and
     returns a vector whose elements contain the substring
     starting with the character at position `start' up to
     the character at position `stop'. If `start' is larger
     than the string length then `NA' is returned. If `stop'
     is longer than `start' and error is signalled.

     `substring' is compatible with S.  For vector argu-
     ments, it expands the arguments cyclically.

_S_e_e _A_l_s_o:

     `strsplit', `paste', `nchar'.

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

     substr("abcdef",2,4)
     substring("abcdef",1:6,1:6)
     substr(rep("abcdef",4),1:4,4:5)
     x <- c("asfef", "qwerty", "yuiop[", "b", "stuff.blah.yech")
     all(substr(x, 2, 5) == substring(x, 2, 5)) #> TRUE
     substr(x, 2, 5)
     substring(x, 2, 4:6)

