year-month-weekday-getters {clock}R Documentation

Getters: year-month-weekday

Description

These are year-month-weekday methods for the getter generics.

Usage

## S3 method for class 'clock_year_month_weekday'
get_year(x)

## S3 method for class 'clock_year_month_weekday'
get_month(x)

## S3 method for class 'clock_year_month_weekday'
get_day(x)

## S3 method for class 'clock_year_month_weekday'
get_index(x)

## S3 method for class 'clock_year_month_weekday'
get_hour(x)

## S3 method for class 'clock_year_month_weekday'
get_minute(x)

## S3 method for class 'clock_year_month_weekday'
get_second(x)

## S3 method for class 'clock_year_month_weekday'
get_millisecond(x)

## S3 method for class 'clock_year_month_weekday'
get_microsecond(x)

## S3 method for class 'clock_year_month_weekday'
get_nanosecond(x)

Arguments

x

⁠[clock_year_month_weekday]⁠

A year-month-weekday to get the component from.

Value

The component.

Examples

monday <- clock_weekdays$monday
thursday <- clock_weekdays$thursday

x <- year_month_weekday(2019, 1, monday:thursday, 1:4)
x

# Gets the weekday, 1 = Sunday, 7 = Saturday
get_day(x)

# Gets the index indicating which instance of that particular weekday
# it is in the current month (i.e. the "1st Monday of January, 2019")
get_index(x)

[Package clock version 0.7.1 Index]