![]() ![]() UK convention : Week of the year as decimal number (00–53) using Monday as the first day of week (and typically with the first Monday of the year as day 1 of week 1): %W.US convention : Week of the year as decimal number (00–53) using Sunday as the first day 1 of the week (and typically with the first Sunday of the year as day 1 of week 1): %U.I'm adding an excerpt from this SO post: Week of the year The US convention.Ĭreated on by the reprex package (v0.2.1) Week of the year as decimal number (00–53) using Sunday as the first day 1 of the week (and typically with the first Sunday of the year as day 1 of week 1). Weekday as a decimal number (1–7, Monday is 1). Here's from the documentation of strptime: I think you're experiencing the issue with as.Date because the way R counts the week numbers. Because of this rule, December 29, 30, and 31 could potentially fall into MMWR week #1 of the following MMWR year. If January 1 occurs on a Thursday, Friday, or Saturday, the calendar week that includes January 1 would be the last MMWR week of the previous year ( #52 or #53). For example, if January 1 occurs on a Sunday, Monday, Tuesday or Wednesday, the calendar week that includes January 1 would be MMWR week #1. MMWR week #1 of an MMWR year is the first week of the year that has at least four days in the calendar year. ![]() MMWR week numbering is sequential beginning with 1 and incrementing with each week to a maximum of 52 or 53. The first day of any MMWR week is Sunday. It of course follows the convention mentioned in the documentation: I haven't used MMWRweek package before, but it seems to work: MMWRweek::MMWRweek2Date(MMWRyear = 2015, ![]()
0 Comments
Leave a Reply. |