Skip to contents

This function returns categorical values for any date(s) using year cuts such as bimonths, quarters, terms, and halves.

Usage

date_cuts(date = Sys.Date(), type = "Q")

Arguments

date

Date. Date we wish to transform

type

Character. Any of the following: B (2 months), Q (3 months), T (4 months), H (6 months)

Value

Vector with date cut for each date

Examples

date_cuts(Sys.Date(), type = "Q")
#> [1] "Q4"
date_cuts(Sys.Date(), type = "H")
#> [1] "H2"