date_bop: start/end date by period

View source: R/date_funcs.R

date_bopR Documentation

start/end date by period

Description

The date of bop (beginning of period) or eop (end of period).

Usage

date_bop(freq, x, workday = FALSE)

date_eop(freq, x, workday = FALSE)

Arguments

freq

the frequency of period. It supports weekly, monthly, quarterly and yearly.

x

a date

workday

logical, whether to return the latest workday

Value

date_bop returns the beginning date of period of corresponding x by frequency.

date_eop returns the end date of period of corresponding x by frequency.

Examples

date_bop('weekly', Sys.Date())
date_eop('weekly', Sys.Date())

date_bop('monthly', Sys.Date())
date_eop('monthly', Sys.Date())


xefun documentation built on Aug. 10, 2023, 5:07 p.m.