Learn R Programming

lares (version 5.1.0)

date_cuts: Convert Date into Year + Cut

Description

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

See Also

Other Data Wrangling: balance_data(), categ_reducer(), cleanText(), date_feats(), formatNum(), holidays(), impute(), left(), normalize(), ohe_commas(), ohse(), removenacols(), replaceall(), textFeats(), textTokenizer(), vector2text(), year_month()

Examples

Run this code
# NOT RUN {
date_cuts(Sys.Date(), type = "Q")
date_cuts(Sys.Date(), type = "H")
# }

Run the code above in your browser using DataLab