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 )
The year. Values
The month. Values
The weekday of the month. Values
The index specifying that
The hour. Values
The minute. Values
The second. Values
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.
The precision to interpret
A year-month-weekday calendar vector.
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.
# 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#> <year_month_weekday<day>> #>  "2019-01-Fri" "2019-01-Fri" "2019-01-Fri" "2019-01-Fri" #>  "2019-01-Fri"#>  FALSE FALSE FALSE FALSE TRUE# Resolve this invalid date by using the previous valid date invalid_resolve(x, invalid = "previous")#> <year_month_weekday<day>> #>  "2019-01-Fri" "2019-01-Fri" "2019-01-Fri" "2019-01-Fri" #>  "2019-01-Thu"