0

I have this df:

df = data.frame(ID = c(1,2,3),
              A = c("h;d;c", "j;k", "k"))

And i want to retrieve a new df with splited rows based on ";" character, just like this:

  ID A
1  1 h
2  1 d
3  1 c
4  2 j
5  2 k
6  3 k

I searched for other questions, but they need an exact amount of expected characters. (Split data frame string column into multiple columns)

Thanks for the help!

Bryan Souza
  • 365
  • 1
  • 9

0 Answers0