year-month-weekday-widen: Widen: year-month-weekday

Description Usage Arguments Details Value Examples

Description

This is a year-month-weekday method for the calendar_widen() generic. It widens a year-month-weekday vector to the specified precision.

Usage

1
2
## S3 method for class 'clock_year_month_weekday'
calendar_widen(x, precision)

Arguments

x

[clock_year_month_weekday]

A year-month-weekday vector.

precision

[character(1)]

One of:

  • "year"

  • "month"

  • "day"

  • "hour"

  • "minute"

  • "second"

  • "millisecond"

  • "microsecond"

  • "nanosecond"

Details

Widening a month precision year-month-weekday to day precision will set the day and the index to 1. This sets the weekday components to the first Sunday of the month.

Value

x widened to the supplied precision.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Month precision
x <- year_month_weekday(2019, 1)
x

# Widen to day precision
# Note that this sets both the day and index to 1,
# i.e. the first Sunday of the month.
calendar_widen(x, "day")

# Or second precision
sec <- calendar_widen(x, "second")
sec

clock documentation built on April 23, 2021, 1:06 a.m.