day_type: Get Day Type

Description Usage Arguments Value Examples

View source: R/trad-one-access.R

Description

Get Day Type

Usage

1
day_type(x, weekend = c("Saturday", "Sunday"), holidays = NULL)

Arguments

x

A Date vector to get the day types for.

weekend

A string indicating the days to be considered weekend.

holidays

A Date vector of weekday holidays that can be treated as weekends.

Value

A factor of the day types ('Week' or 'Weekend').

Examples

1
2
3
day_type(seq(as.Date("2000-12-01"), as.Date("2000-12-31"), by = "day"))
day_type(seq(as.Date("2000-12-01"), as.Date("2000-12-31"), by = "day"), 
  holidays = as.Date("2000-12-25"))

poissonconsulting/creelr documentation built on Feb. 11, 2021, 2:22 p.m.