I am looking to find the week within a year in R for a list of dates. However, The outputs are rather weird.
See below:
week("2000-01-01")
week("2000-01-06")
week("2000-01-07")
week("2000-01-13")
week("2000-01-14")
This returns 1, 1, 2, 2, 3
However, if you look at a calendar: http://calendars.generalblue.com/content/images/calendars/2000/01-January-2000-Calendar.png
You'd expect it to be 1, 2, 2, 3, 3.
For some reason, this rolls over on a Thursday. Isn't that strange?
Does anyone know how I should do this to get the expected 1, 2, 2, 3, 3 results?
Have a look at
?week
Using the function isoweek you get the following result.
So when does a week "start" for you? In the following date-function a week start's on Sunday