weekday_find_closest: Find the closest date matching a day of the week

Description Usage Arguments Details

View source: R/datetime.R

Description

Given a reference date object and a weekday as a string or numeric index, finds the closest instance of that weekday that happened before the reference date.

Usage

1
weekday_find_closest(weekday, reference = NULL)

Arguments

weekday

a day of the week, as a string or an index. These are locale-specific. Use weekday_labels to figure out the valid labels for your system.

reference

a reference date from where to look for the required weekday.

Details

For instance, if the reference date is a Friday and the weekday is "Saturday", the function will return last Saturday.


gmega/megautils documentation built on Sept. 14, 2020, 8:06 p.m.