Q:

using the spread and/or dcast command

Suppose I have the following data frame:
Name Type Date   Description   CorrectionCode
Bob  X1   01/01  Desc1            394
Bob  X2   01/01  Desc2            9348
Jim  X3   03/04  Desc4            934

How would I get that into
Name Type Date Description1 CorrectionCode1 Description2 CorrectionCode2
Bob   X1  01/01  Desc1          394           Desc2          9348
Jim   X3  03/04  Desc4           934

I'm trying to do this using spread spread in tidyR but am happy to use something else. 

A:

You can try dcast from the devel version of data.table ie.  v1.9.5.   Instructions to install are here
library(data.table)
dcast(setDT(df1)[, c('Type', 'Seq'):= list(Type[1L], 1:.N) , Name],
    Name+Type+Date~Seq, value.var=c('Description', 'CorrectionCode'))
#    Name Type  Date 1_Description 2_Description 1_CorrectionCode
#1:  Bob   X1 01/01         Desc1         Desc2              394
#2:  Jim   X3 03/04         Desc4            NA              934
#   2_CorrectionCode
#1:             9348
#2:               NA

