DF <- structure(list(Date = structure(c(11432, 11797, 11432, 12162,
12528, 13258, 14354, 12162, 12162, 12893, 14719, 14719, 16545,
16545), class = "Date"), Stage = c("Applied", "Screened", "Applied",
"Screened", "Applied", "Screened", "Interview", "Applied", "Applied",
"Screened", "Interview", "Interview", "Offer", "Offer"), ID = c(1,
1, 2, 2, 3, 3, 3, 6, 7, 6, 6, 1, 3, 6)), row.names = c(NA, -14L
), class = c("tbl_df", "tbl", "data.frame"))
I have a data frame, which I have attached. I need to transform the data frame, in order to analyse my data properly. I want to group the IDs as rows and make the different stages like "Applied", "Screened" and "Interviews" etc...header columns. I then want the data frame to be filled with the dates for each ID and stage. I approached the problem using the code DF <- dcast(DF, ID + Date ~ Stage)
. However I do not get the dates within the table, I just get my IDs for some reason. Any advise will be highly appreciated please.