I have a quite big data frame in R with two columns. I am trying to make out of the Code column (factor type with 858 levels) the dummy variables.
Code
factor
This worked for me perfectly:
library(reshape2) m <- acast(data = d, User ~ Code)
The only thing was that it produced NAs, instead of 0s, but this can be easily changed with this:
NA
0
m[is.na(m)] <- 0