I have a data frame with two columns: ID and product. The product contains a list of items like the ones below:
| ID | Product |
|---|---|
| 1 | 'desk','chair','clock' |
| 2 | NA |
| 3 | 'pen' |
I want to extract every single product in a separate row with the corresponding ID, as below:
| ID | Product |
|---|---|
| 1 | 'desk' |
| 1 | 'chair' |
| 1 | 'clock' |
| 3 | 'pen' |
It would be appreciated if you had any suggestions.