Having a long format like this:
df <- data.frame(id = c(1,1,1,2,2), text = c("stock","arrange","stock","arrange","arrange"))
How is it possible to receive the wide format of making the variables in text column new columns which have as values the number the exist? Example of expected output:
data.frame(id = c(1,2) stock = c(2,0), arrange = c(1,2))