Transform a column with several values (separated by a comma) into several rows.

Hello, I hope you are well. I'm starting in R and I have a big question, I hope you can help me.

I have a database that contains a column (column k) with cells containing comma separated values. I need to create a new row for each value in the cell associated with the column that contains it (column k). Then, for each new row, I need to copy all the observations from the source row of the comma-separated values (a - j). And so on for each cell containing comma-separated values, from column k.

Translated with DeepL Translator | World's Most Accurate Translator (free version)

image

There's a function called separate_rows() that does exactly this. Here's a tweet with an example gif, if you want to see it in action:
https://twitter.com/dataandme/status/1113513004795146241?s=20

Thank you, very much.

It served me very well!

Best regards,