Learn R Programming

lares (version 4.8.4)

dateformat: Transform any date input into Date

Description

This function lets the user transform any date input format into a conventional R date format. The following formats are some of the permitted: 10-05-2019, 2019-10-05 5/22/2015, 9:45:03 AM, 42348.44, 9/2/18 23:16, 10-05-19

Usage

dateformat(dates, metric = TRUE, origin = "1900-01-01")

Arguments

dates

Vector. Dates in any of the permitted formats

metric

Boolean. Metric or Imperial inputs. The main difference is that Metric follows the DD/MM/YYYY pattern, and Imperial follows the MM/DD/YYYY pattern.

origin

Date. When importing from Excel, integers usually have 1900-01-01 as origin. In R, origin is 1970-01-01.

See Also

Other Data Wrangling: balance_data(), categ_reducer(), cleanText(), date_cuts(), date_feats(), formatNum(), formatTime(), holidays(), impute(), left(), normalize(), numericalonly(), ohe_commas(), ohse(), rbind_full(), removenacols(), removenarows(), replaceall(), right(), textFeats(), textTokenizer(), vector2text(), year_month(), year_week()