0

I have a table which has data like this:

Value      ID
I           1
already     1
tried       2
this        2
but         2
did         3
not         3
work        4
please      4
help        5
me          6

I expect the output to be:

Value1     value2      VALUE3       ID
I          already                   1
tried      this        but           2
did        not                       3
work       please                    4
help                                 5
me                                   6

So rows having same ID has to separated into number of columns= number of rows with same ID.

i have used spread function. but it didn't work.

IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • For a more informative answer , please show what searching you have done and _how_ you have tried to use spread. – IRTFM Jul 18 '17 at 23:30
  • Jaap's answer in particular covers the dplyr/tidyr solution - https://stackoverflow.com/a/35254375/496803 – thelatemail Jul 18 '17 at 23:42

0 Answers0