Lubridate wday wrong week number

50 Views Asked by At

I am using lubridate::week()to calculate the week number for '2024-01-07'

> week('2024-01-07')
[1] 1

Where

> wday('2024-01-07', label = T)
[1] Sun
Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat

I am fine with Sunday being the first day of the week.

However, I would like to assign '2024-01-07' to the second week of year 2024, like it would be on a calendar, where the 1st of 2024 would be missing a Sunday, and Sunday January 7th should be assigned to the second week.

How do I achieve that?

0

There are 0 best solutions below