Learn R Programming

ymd (version 0.1.5)

beop: Find the Beginning or End of Period

Description

Each of bop and eop contains a list of functions, whose names all consist of two letters, the first of which stands for last, this, next while the second stands for year, quarter, month, week. For example, eop$ty() means "the ending of period of this year" and bop$lm() means "the beginning of period of last month".

Arguments

Details

All functions' signatures are the same, with only one argument x, which could be a Date or values that can be converted to Date via ymd().

Examples

Run this code
bop$ty(as.Date("2021-03-02"))
## supports 'YMD' formatted integer or string
bop$ty(210302)
eop$tm(200201)

Run the code above in your browser using DataLab