0

For example, the data is:

a <- tibble(id=1:2,
            text=c('aaa. bb cc. d','a b c. sdf afd. fer fer fe fe. def'))

I want for the column text, I use '.' to split each string into multiple strings. Then put the new strings into a new data frame, like:

id text
1  aaa
1  bb cc
1  d
2  a b c
2  sdf afd
2  fer fer fe fe
2  def

I guess apply family can do this, But I just do not know how.

halfer
  • 19,824
  • 17
  • 99
  • 186
Feng Chen
  • 2,139
  • 4
  • 33
  • 62
  • 1
    Almost certainly a duplicate of https://stackoverflow.com/questions/13773770/split-comma-separated-strings-in-a-column-into-separate-rows unless there is some complication I'm missing. – thelatemail Nov 11 '19 at 04:39
  • yeah. exactly what i want. thanks – Feng Chen Nov 11 '19 at 04:46
  • Marked for deletion. – halfer Nov 13 '19 at 11:52
  • As per past comments, when asking questions, we would rather they were written in a technical and neutral style. Chatty material that begs, pleads and implores readers for an answer may be thought of as somewhat coercive, and is not really appropriate for the volunteer audience. Please keep it succinct. Thank you! – halfer Nov 13 '19 at 11:53

0 Answers0