Learn R Programming

lares (version 4.7)

date_feats: One Hot Encoding for Date/Time Variables (Dummy Variables)

Description

This function lets the user automatically create new columns out of a dataframe or vector with date/time variables.

Usage

date_feats(dates, keep_originals = FALSE, only = NA, features = TRUE,
  holidays = FALSE, country = "Colombia", currency_pair = NA,
  summary = TRUE)

Arguments

dates

Vector or dataframe. Non-date/time columns will be automatically ignored.

keep_originals

Boolean. Should the original date/time columns be kept in the results?

only

Character or vector. Which columns do you wish to process? If non are explicitly defined, all will be processed

features

Create features out of date/time columns?

holidays

Boolean. Include holidays as new columns?

country

Character or vector. For which countries should the holidays be included?

currency_pair

Character. Which currency exchange do you wish to get the history from? i.e, USD/COP, EUR/USD...

summary

Boolean. Print a summary of the operations?

See Also

Other Data Wrangling: balance_data, calibrate, categ_reducer, cleanText, dateformat, formatNum, formatTime, holidays, impute, left, normalize, numericalonly, ohse, one_hot_encoding_commas, rbind_full, removenacols, removenarows, replaceall, right, textFeats, textTokenizer, vector2text, year_month, year_week

Other Feature Engineering: holidays, ohse