I have a data.frame that looks like this:
> head(ff.df) .id pio caremgmt prev price surveyNum 1 1 2 2 1 2 1 2 1 2 1
You can do this with the reshape function in base R. The column ordering is a little weird, but can be fixed easily.
reshape
base
reshape(ff.df, direction = 'wide', idvar = "surveyNum", timevar = '.id')