This is a yearmonthday method for the calendar_start()
and
calendar_end()
generics. They adjust components of a calendar to the
start or end of a specified precision
.
# S3 method for clock_year_month_day calendar_start(x, precision) # S3 method for clock_year_month_day calendar_end(x, precision)
x 
A yearmonthday vector. 

precision 
One of:

x
at the same precision, but with some components altered to be
at the boundary value.
#> <year_month_day<hour>[3]> #> [1] "20190205 06" "20190305 06" "20190405 06"#> <year_month_day<hour>[3]> #> [1] "20190201 00" "20190301 00" "20190401 00"#> <year_month_day<hour>[3]> #> [1] "20190228 23" "20190331 23" "20190430 23"# Compare that with just setting the day of the month to `"last"`, which # doesn't adjust any other components set_day(x, "last")#> <year_month_day<hour>[3]> #> [1] "20190228 06" "20190331 06" "20190430 06"# You can't compute the start / end at a more precise precision than # the input is at try(calendar_start(x, "second"))#> Error : Can't compute the start of `x` (hour) at a more precise precision (second).