date_to_week_end: Convert a date to the last date of the week it's in

View source: R/utils.R

date_to_week_endR Documentation

Convert a date to the last date of the week it's in

Description

The day on which the week ends is given by the config variable week_end_day

Usage

date_to_week_end(
  x,
  type = c("target", "forecast"),
  config_file = here::here("project-config.json")
)

Arguments

x

date to convert

type

character, whether to define weeks as for the "target" (default, i.e. week definition of the forecasts/targets) or "forecast", the forecast submission cycle, i.e. the week will end on the week day on which forecasts are submitted.

config_file

Path to the config file

Value

converted date

Author(s)

Sebastian Funk


epiforecasts/forecasthubutils2 documentation built on July 1, 2023, 11:50 a.m.