This question probably already exists but my biggest issue was in how to phrase the question, so if you could point me to the post with the answer I'd greatly appreciate it!
I have a data frame:
test <- data.frame(A = c("A", "B"),
B = c("This is a long string", "This is another long string"))
A B
1 A This is a long string
2 B This is another long string
And I'd like the output to still only have two columns, but break the second column up by " "
and have the first column repeated so that:
A B
1 A This
2 A is
3 A a
4 A long
5 A string
6 B This
7 B is
8 B another
9 B long
10 B string