I have a data frame with two columns as:
**+-----+-------+
| V1 | V2 |
+-----+---------+
| 1 | a,b,c |
| 2 | a,c |
| 3 | b,d |
| 4 | e |
| . | . |
+-----+-------+**
I want to split the second column to multiple columns based on a marker character inside the second column. I want the output to be like following.
**+-----+-------------+
| V1 | V2 | V3 | V4 |
+-----+---------------+
| 1 | a | b | c |
| 2 | a | c | NA |
| 3 | b | d | NA |
| 4 | e | NA | NA |
| . | . | . | . |
+-----+-------------+**
This is a generalization of this question but with unbalanced sizes. For example the following example:
myVec <- c("F.US.CLE.V13", "F.US.CA6.U13", "F.US.CA6.U13","F.US.CA6", "F.US", "F")