# NOT RUN {
# New Year's 2019 is the third day of the week starting on a Sunday
s <- date2week(as.Date("2019-01-01"), week_start = "Sunday")
s
# It's the second day of the week starting on a Monday
m <- change_week_start(s, "Monday")
m
# When you compare the underlying dates, they are exactly the same
identical(as.Date(s), as.Date(m))
# Since this will pass arguments to `date2week()`, you can modify other
# aspects of the aweek object this way, but this is not advised.
change_week_start(s, "Monday", floor_day = TRUE)
# }
Run the code above in your browser using DataLab