I am trying to transpose event and updated_time columns, such that for each id i would get the updated_time for each event.
Initial dataframe
id event updated_time
085d478f5 one 2016-08-30 05:51:25
085d478f5 two 2016-08-29 02:31:34
1006be496 one 2016-08-27 17:56:19
1006d6182 three 2016-08-13 10:30:08
Final dataframe (After transformation)
id one two three
085d478f5 2016-08-30 05:51:25 2016-08-29 02:31:34 NA
1006be496 2016-08-27 17:56:19 NA NA
1006d6182 NA NA 2016-08-13 10:30:08
I have tried spread() function from dplyr on a larger dataset, but i am getting following error:
"Error: Duplicate identifiers for rows"