What is the most simpel way using tidyr
or reshape2
to turn this data:
data <- data.frame(
A=c(1,2,3),
B=c("b,g","g","b,g,q"))
Into (e.g. make a row for each comma separated value in variable B
):
A B
1 1 b
2 1 g
3 2 g
4 3 b
5 3 g
6 3 q
Try
Or using
base R
Or