iso-year-week-day-getters: Getters: iso-year-week-day

iso-year-week-day-gettersR Documentation

Getters: iso-year-week-day

Description

These are iso-year-week-day methods for the getter generics.

  • get_year() returns the ISO year. Note that this can differ from the Gregorian year.

  • get_week() returns the ISO week of the current ISO year.

  • get_day() returns a value between 1-7 indicating the weekday of the current ISO week, where 1 = Monday and 7 = Sunday, in line with the ISO standard.

  • There are sub-daily getters for extracting more precise components.

Usage

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

## S3 method for class 'clock_iso_year_week_day'
get_week(x)

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

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

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

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

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

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

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

Arguments

x

⁠[clock_iso_year_week_day]⁠

A iso-year-week-day to get the component from.

Value

The component.

Examples

x <- iso_year_week_day(2019, 50:52, 1:3)
x

# Get the ISO week
get_week(x)

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

# Note that the ISO year can differ from the Gregorian year
iso <- iso_year_week_day(2019, 1, 1)
ymd <- as_year_month_day(iso)

get_year(iso)
get_year(ymd)

clock documentation built on May 31, 2023, 9:39 p.m.