Learn R Programming

lares (version 5.2.13)

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)

Value

Vector with dates reformatted

Arguments

date

Date vector. Date to transform format.

See Also

Other Data Wrangling: balance_data(), categ_reducer(), cleanText(), date_cuts(), date_feats(), file_name(), formatHTML(), holidays(), impute(), left(), normalize(), num_abbr(), ohe_commas(), ohse(), quants(), removenacols(), replaceall(), replacefactor(), textFeats(), textTokenizer(), vector2text(), zerovar()

Examples

Run this code
year_month(Sys.Date())
year_quarter(Sys.Date())
year_week(Sys.Date())

Run the code above in your browser using DataLab