First Day of Year

year_first(
  date = today(),
  year_start_month = get_year_start_month(),
  year_start_day = get_year_start_day(),
  round = FALSE,
  week_start = 1L,
  week_min = get_week_min(),
  iso = FALSE,
  locale = NULL
)

Arguments

date

Date or year vector

year_start_month

integer 1L for January (default) and 12L for December

year_start_day

integer 1L for first day and 31L to last day of year_start_month

round

logical

week_start

integer Only used if round. 1L for Monday (default) and 7l for Friday

week_min

integer Only used if round. A which point should should date start being rounded up?

  • 1L always rounds Up to the next given day

  • 3L rounds the last 4 days of the week to the next given day (HalfDown)

  • 4L (ISO) rounds the last 4 days of the week to the next given day and the first 3 days of the week to the previous given day (HalfUp)

  • 7L always rounds Down to the previous given day

iso

logical

locale

logical to catch current locale or character language code

Value

Datevector