Learn R Programming

dbnR (version 0.7.1)

filtered_fold_dt: Fold a dataset to a certain size and avoid overlapping of different time-series

Description

If the dataset that is going to be folded contains several different time-series instances of the same process, folding it could introduce false rows with data from different time-series. Given an id variable that labels the different instances of a time series inside a dataset and a desired size, this function folds the dataset and avoids mixing data from different origins in the same instance.

Usage

filtered_fold_dt(dt, size, id_var, clear_id_var = TRUE)

Arguments

dt

data.table to be folded

size

the size of the data.table

id_var

the variable that labels each individual instance of the time-series

clear_id_var

boolean that decides whether or not the id_var column is deleted

Value

the filtered dataset