Start first day of week of the year on Sunday and end last day of week of the year on Saturday
问题 I have recently encountered a problem in R dealing with the dates. The last day of 2015 (2015-12-31) falls on Thursday, meaning last week of the year only contains 5 days if I consider Sunday as the start day of my week. Now, I would like 2016-01-01 and 2016-01-02, which fall on Friday and Saturday, to be associated with week 53, and start week 1 on 2016-01-03, which falls on Sunday. require(lubridate) range <- seq(as.Date('2015-12-26'), by = 1, len = 10) df <- data.frame(range) df$WKN <- as