Learn R Programming

lares (version 5.1.0)

year_month: Convert Date into Year-Month, Year-Quarter or Year-Week Format

Description

This function lets the user convert a date into YYYY-MM, YYYY-QX, or YYYY-WW format easily.

Usage

year_month(date)

year_quarter(date)

year_week(date)

Arguments

date

Date vector. Date to transform format.

Value

Vector with dates reformatted

See Also

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

Examples

Run this code
# NOT RUN {
year_month(Sys.Date())
year_quarter(Sys.Date())
year_week(Sys.Date())
# }

Run the code above in your browser using DataLab