In R, how can I associate between a vector of dates (days) and weeks?
Edit: \"weeks\" should be the week index within the date range and not within the year. My apol
Do you just want the number of completed 7 day intervals since the first record?
dvec <- as.Date("2001-04-01")+0:90 dweek <- as.numeric(dvec-dvec[1]) %/% 7 dweek[1:21] # [1] 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 2 2