I am trying to recode my time variable in my dataset. Currently, my dataset reflects data for all of December and I would like to re-code the dates so that there is a variable that includes week1, week2, week3, and week4.
My date is formatted as
december$DATE <- as.Date(december$DATE, "%m/%d/%Y")
This is my current attempt at re-coding, but to no avail:
december$week <- cut (december$DATE,
breaks = c(-Inf, 12/08/2016, 12/15/2016, 12/22/2016, Inf),
labels=c("W1", "W2", "W3", "W4"))
The traditional way of recoding continuous into categorical is not applicable in this case. Any suggestions?