table transformation


I have the following table
1,323,2/2/2014 12:11:07 AM
2,3234,2/2/2014 1:11:07 AM
3,6543,2/2/2014 2:11:07 AM
1,323,2/2/2014 3:11:07 AM
2,3234,2/2/2014 4:11:07 AM
3,6543,2/2/2014 5:11:07 AM

i need to transform it to where userid becomes column

2/2/2014 12:11:07 AM,323,null,null
2/2/2014 1:11:07 AM,null,3234,null
2/2/2014 2:11:07 AM,null,null,6543
2/2/2014 3:11:07 AM,323,null,null
2/2/2014 4:11:07 AM,null,3234,null
2/2/2014 5:11:07 AM,null,null,6543

how do i do this using R


@t1279k this probably isn't too bad but helping is more difficult because we can't really work with your example without going to a lot of work reformatting. I suggest you edit exactly what you have (great info) but use code tags. At the end please supply the code you used to make dataframe 1 using dput. That makes sure we can cut and paste exactly.

When you're posting code, dataframes or computer output it's helpful to wrap this information in code tags by:
  1. either clicking the pound (#) sign icon or
  2. wrap with [NOPARSE]
    some code

which produces:
some code
For more see this (LINK)