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 (free version)

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:

Thank you, very much.

It served me very well!

Best regards,

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.