0

I am new to learning coding and stackoverflow and am struggling with the following:

ID
1
2
3


ITEMS
c(a,b,c)
a
b

I want a new dataframe that will output the following

ID
1
1
1
2
3

ITEMS
a
b
c
a
b

So I want to effectively unlist my ITEMS column but at the same time replicating/matching my ID column.

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
  • Please add data using `dput` and show the expected output for the same. Read about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269). – Ronak Shah Oct 04 '20 at 01:28
  • Try `df1 <- tidyr::unnest(df, ITEMS)` – Ronak Shah Oct 04 '20 at 01:29
  • @RonakShah Thank you very much. I will also read up on how to frame good questions as you suggest. Thanks again. – SlackToe8 Oct 04 '20 at 02:52

0 Answers0