simple_td function

Generate simple working day variable

Generate simple working day variable

Aggregates the count of full working days within a week and normalizes it.

simple_td(dates, df.td)

Arguments

  • dates: a vector of class "Date", containing the data dates
  • df.td: dataframe with working days. Its should consit of 2 columns named as "date" and "WORKING_DAY_PART". date column should be of class "Date". WORKING_DAY_PART should be similar to ISR_WORKING_DAY_PART in dates_il

Returns

matrix with trading day variables

Examples

library(dplyr) data(dates_il) data(gasoline.data) dates_il%>% dplyr::select(DATE_VALUE,ISR_WORKING_DAY_PART)%>% `colnames<-`(c("date","WORKING_DAY_PART"))%>% dplyr::mutate(date=as.Date(date))->df.td td=simple_td(dates = gasoline.data$date,df.td = df.td)
  • Maintainer: Tim Ginker
  • License: MIT + file LICENSE
  • Last published: 2025-02-05