row_expand_dates {dataMojo}R Documentation

Expand row given start and end dates

Description

Expand row given start and end dates

Usage

row_expand_dates(dt, start_date_col, end_date_col, new_name)

Arguments

dt

input data table

start_date_col

start date column

end_date_col

end date column

new_name

new generated column name

Value

expanded data table

Examples

dt_dates_simple <- data.table::data.table(
  Start_Date = as.Date(c("2020-02-03", "2020-03-01") ),
  End_Date = as.Date(c("2020-02-05", "2020-03-02") ),
  group = c("A", "B")
)
row_expand_dates(dt_dates_simple, "Start_Date", "End_Date", "Date")[]

[Package dataMojo version 1.0.0 Index]