year_month_weekday {clock} | R Documentation |
year_month_weekday()
constructs a calendar vector from the Gregorian
year, month, weekday, and index specifying that this is the n-th weekday
of the month.
year_month_weekday(
year,
month = NULL,
day = NULL,
index = NULL,
hour = NULL,
minute = NULL,
second = NULL,
subsecond = NULL,
...,
subsecond_precision = NULL
)
year |
The year. Values |
month |
The month. Values |
day |
The weekday of the month. Values |
index |
The index specifying that If |
hour |
The hour. Values |
minute |
The minute. Values |
second |
The second. Values |
subsecond |
The subsecond. If specified, If using milliseconds, values If using microseconds, values If using nanoseconds, values |
... |
These dots are for future extensions and must be empty. |
subsecond_precision |
The precision to interpret |
Fields are recycled against each other.
Fields are collected in order until the first NULL
field is located. No
fields after the first NULL
field are used.
A year-month-weekday calendar vector.
# All Fridays in January, 2019
# Note that there was no 5th Friday in January
x <- year_month_weekday(
2019,
clock_months$january,
clock_weekdays$friday,
1:5
)
x
invalid_detect(x)
# Resolve this invalid date by using the previous valid date
invalid_resolve(x, invalid = "previous")