Learn R Programming

RemixAutoML (version 0.11.0)

CreateCalendarVariables: CreateCalendarVariables Create Caledar Variables

Description

CreateCalendarVariables Rapidly creates calendar variables based on the date column you provide

Usage

CreateCalendarVariables(data, DateCols = c("Date", "Date2"),
  AsFactor = FALSE, TimeUnits = "wday")

Arguments

data

This is your data

DateCols

Supply either column names or column numbers of your date columns you want to use for creating calendar variables

AsFactor

Set to TRUE if you want factor type columns returned; otherwise integer type columns will be returned

TimeUnits

Supply a character vector of time units for creating calendar variables. Options include: "second", "minute", "hour", "wday", "mday", "yday", "week", "isoweek", "month", "quarter", "year"

Value

Returns your data.table with the added calendar variables at the end

See Also

Other Feature Engineering: AutoDataPartition, AutoTransformationCreate, AutoTransformationScore, AutoWord2VecModeler, CreateHolidayVariables, DT_GDL_Feature_Engineering, DummifyDT, GDL_Feature_Engineering, ModelDataPrep, Partial_DT_GDL_Feature_Engineering, Scoring_GDL_Feature_Engineering, TimeSeriesFill

Examples

Run this code
# NOT RUN {
data <- data.table::data.table(Date = "2018-01-01 00:00:00")
data <- CreateCalendarVariables(data,
                                DateCols = "Date",
                                AsFactor = FALSE,
                                TimeUnits = c("wday", "month", "year"))
# }

Run the code above in your browser using DataLab