calendar-boundary: Boundaries: calendars

Description Usage Arguments Value Examples

Description

For both calendar_start() and calendar_end(), the precision of x is always retained.

Each calendar has its own help page describing the precisions that you can compute a boundary at:

Usage

1
2
3
calendar_start(x, precision)

calendar_end(x, precision)

Arguments

x

[calendar]

A calendar vector.

precision

[character(1)]

A precision. Allowed precisions are dependent on the calendar used.

Value

x at the same precision, but with some components altered to be at the boundary value.

Examples

1
2
3
4
5
6
7
8
9
# Hour precision
x <- year_month_day(2019, 2:4, 5, 6)
x

# Compute the start of the month
calendar_start(x, "month")

# Or the end of the month, notice that the hour value is adjusted as well
calendar_end(x, "month")

clock documentation built on Sept. 21, 2021, 5:10 p.m.