Generics and methods for accessing information about grouped date objects.
Usage
get_firstday(x, ...)
# Default S3 method
get_firstday(x, ...)
# S3 method for class 'grates_yearweek_monday'
get_firstday(x, ...)
# S3 method for class 'grates_yearweek_tuesday'
get_firstday(x, ...)
# S3 method for class 'grates_yearweek_wednesday'
get_firstday(x, ...)
# S3 method for class 'grates_yearweek_thursday'
get_firstday(x, ...)
# S3 method for class 'grates_yearweek_friday'
get_firstday(x, ...)
# S3 method for class 'grates_yearweek_saturday'
get_firstday(x, ...)
# S3 method for class 'grates_yearweek_sunday'
get_firstday(x, ...)
get_week(x, ...)
# Default S3 method
get_week(x, ...)
# S3 method for class 'grates_yearweek'
get_week(x, ...)
# S3 method for class 'grates_epiweek'
get_week(x, ...)
# S3 method for class 'grates_isoweek'
get_week(x, ...)
get_year(x, ...)
# Default S3 method
get_year(x, ...)
# S3 method for class 'grates_yearweek'
get_year(x, ...)
# S3 method for class 'grates_epiweek'
get_year(x, ...)
# S3 method for class 'grates_isoweek'
get_year(x, ...)
# S3 method for class 'grates_yearmonth'
get_year(x, ...)
# S3 method for class 'grates_yearquarter'
get_year(x, ...)
# S3 method for class 'grates_year'
get_year(x, ...)
get_n(x, ...)
# Default S3 method
get_n(x, ...)
# S3 method for class 'grates_month'
get_n(x, ...)
# S3 method for class 'grates_period'
get_n(x, ...)
# S3 method for class 'grates_int_period'
get_n(x, ...)
get_offset(x, ...)
# Default S3 method
get_offset(x, ...)
# S3 method for class 'grates_period'
get_offset(x, ...)
Examples
dates <- as.Date("2020-01-01") + 1:14
dat <- as_isoweek(dates)
get_week(dat)
#> [1] 1 1 1 1 2 2 2 2 2 2 2 3 3 3
get_year(dat)
#> [1] 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020