The day of week (aka weekday of dow) is an integer index ranging from 1 (representing Monday) to 7 (representing Sunday).

The names of the days of weeks are system dependent, based on the LC_TIME locale and generated on the fly.

day_of_week(
  x = today(),
  label = FALSE,
  format = c("wide", "abbreviated", "narrow"),
  pretty = FALSE,
  dot = TRUE,
  reverse = FALSE,
  week_start = get_week_start(),
  locale = get_lang()
)

Arguments

x

Date vector

label

logical Whether or not to use the day of week names instead of integers.

format

character

pretty

logical if localized labels are in lower case, convert as title

dot

logical Whether or not to strip dots if localized labels contains dots

reverse

logical Should Sunday > Monday (default is Monday < Sunday)

week_start

integer 1 for Monday and 7 for Sunday (only used for labeling)

locale

character ISO 639 language code

Value

integervector by default (orderedfactor if using labels)

See also