I have some nested data within a DF and I would like to expand it to a new DF with all other entries duplicated. For example
x1 x2 x3
1 43 'j,k,d' 'apple'
2 11 'as,ddd' 'pear'
In this DF the variable x2 has multiple entries separated by comma. I would like to produce a new DF that looks the following:
x1 x2 x3
1 43 'j' 'apple'
2 43 'k' 'apple'
3 43 'd' 'apple'
4 11 'as' 'pear'
5 11 'ddd' 'pear'