R/monday_week_date.R

Defines functions monday_week_date

Documented in monday_week_date

#' Return a date variable set to the Monday of the week
#'
#' Function that return for any day of the week a date set to the Monday of that week.
#'
#' @param date a date
#'
#' @return
#' @export
#'
monday_week_date <- function(date) {
  lubridate::wday(date, week_start = 1) <- 1
  return(date)
}
epicentre-msf/covidutils documentation built on July 22, 2021, 1:03 p.m.