get_wday_before_dates: Get the dates of a weekday before a specified date

Description Usage Arguments Value Examples

View source: R/get_weekday_before_dates.R

Description

Get the dates of a weekday before a specified date

Usage

1
get_wday_before_dates(weekday, dates, search = "before")

Arguments

weekday

Character. Name of the week (e.g. "monday")

dates

The date of interest. Format: YYYY-MM-DD.

search

Search "before" of "after" the specified date.

Value

Character vector in the format YYYY-MM-DD.

Examples

1
2
3
4
# search the monday before the "2021-12-29"
date_of_monday <- get_wday_before_dates(weekday = "monday", dates = "2021-12-29", search = "before")
# Confirm
weekdays(as.Date(date_of_monday))

Glender/DutchDayDummies documentation built on Feb. 24, 2022, 7:15 a.m.