next_weekday: Next weekday to a given date

Description Usage Arguments Details

View source: R/show_week.R

Description

Gives the date of a given weekday to a given date

Usage

1
next_weekday(x, index, method = "ceiling")

Arguments

x

date vector

index

which day in the week 0:6, d=0 is Sunday, d=1 is Monday, ..., d=6 is Saturday

method

"ceiling": last day of the week given the weekend. "floor": first day of week

Details

The idea is that relative to the UNIX Epoch that d-4 falls on day of the week d where d=0 is Sunday, d=1 is Monday, ..., d=6 is Saturday so any multiple of 7 days from that also falls on day of the week d.


tjebo/tjebtools documentation built on Nov. 15, 2021, 11:21 p.m.