

strsplit {base}                              R Documentation

_S_p_l_i_t _t_h_e _S_t_r_i_n_g_s _i_n _a _V_e_c_t_o_r

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

     Split the strings in `x' into substrings according to
     the presence of substring `split' within them.

_U_s_a_g_e_:

     strsplit(x,split)

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

       x: character vector, to be split.

   split: character string, to use as "split".  If `split'
          has length 0, `x' is split into single characters.
          If `split' is a vector, it is re-cycled along `x'.

_V_a_l_u_e_:

     A list of length `length(x)' the `i'-th element of
     which contains the vector of splits of `x[i]'.

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

     `paste' for the reverse, `grep' and `sub' for string
     search and manipulation; further `nchar', `substr'.

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

     noquote(strsplit("A text I want to display with spaces", NULL)[[1]])

     x <- c("asfef","qwerty","yuiop[","b","stuff.blah.yech")
     # split x on the letter e
     strsplit(x,"e")

