week_factor: Day of the week as factor/numeric

View source: R/utils_date_time.R

week_factorR Documentation

Day of the week as factor/numeric

Description

Day of the week as factor/numeric

Usage

week_factor(
  x,
  label = FALSE,
  abbr = TRUE,
  week_start = getOption("lubridate.week.start", 7)
)

Arguments

x

chr/Date/POSIXt Days of the week as case insensitive character vector, if using abbreviations, they must be of consistent length. Otherwise, a Date or POSIXt

Value

numeric/factor Depending on the value for label. If x is provided, the day of the week as a factor. If x is not provided, an ordered factor with Monday as 1.

See Also

Other time: duration_print(), excel_date(), month_factor(), season_factor(), time_aggregates, time_difftimes, time_elapsed(), time_factor(), timespan()

Examples

week_factor()
week_factor(c('Tu', 'We'))
week_factor(c('Tu', 'We'), label = TRUE)
week_factor(seq(lubridate::floor_date(Sys.time(), "year"), Sys.time(), by = "day"), label = TRUE, abbr = FALSE)

yogat3ch/UU documentation built on May 31, 2024, 10:14 p.m.