This function adds dummy columns for weekdays (named Sunday, Monday, Tuesday, Wednesday, Thursday, Friday and Saturday) and day parts (morning, afternoon) to the given subset of the specified data set. These are used by var_main to find better models by removing cyclicity from the data set.

set_timestamps(av_state, subset_id = 1, date_of_first_measurement,
measurements_per_day = 1, log_level = 0, first_measurement_index = 1,
add_weekend_as_exogenous = FALSE)

## Arguments

av_state an object of class av_state either an integer subset index or the the value for the id_field column that was used in the group_by function. The subset_id argument is required if the data set is grouped into multiple data sets (i.e., if the group_by function was used), in which case the function works on the specified data subset. the date of the first measurement. This argument should be given in the format: "yyyy-mm-dd", e.g., "2004-03-28". how many measurements were taken per day. This default is 1. It is assumed that every day has exactly this amount of measurements, and that the first measurement in the dataset was the first measurement on that day. sets the minimum level of output that should be shown (a number between 0 and 3). A lower level means more verbosity. Specify a log_level of 3 to hide messages about the exogenous columns being added. is used to specify that the first day of measurements has fewer than measurements_per_day measurements. Here, we assume that the measurements in the data set still form a connected sequence. In other words, the assumption is that the missing measurements of the first day precede the first measurement in the data set. For example, by specifying measurements_per_day = 3, first_measurement_index = 2, the first measurement in the data set will be treated as the second measurement of that day. So the first two measurements in the data set will be tagged with Afternoon and Evening, and the third measurement in the data set will be tagged with Morning of the next day. adds days as exogenous dummy variables to VAR models. adds day parts as exogenous dummy variables to VAR models. adds one exogenous variable named Weekend to the VAR models. This variable is 1 for weekend days (Saturday and Sunday) and 0 otherwise. By specifying add_days_as_exogenous = FALSE and add_weekend_as_exogenous = TRUE, the weekend is used instead of day dummies in the evaluation of models.

## Value

This function returns the modified av_state object.

## Examples

# NOT RUN {
av_state <- load_file("../data/input/pp4 nieuw compleet met 140min.sav",log_level=3)
av_state <- set_timestamps(av_state,date_of_first_measurement="2010-04-14")

# an example with multiple measurements per day:
# }