Learn R Programming

dbnR (version 0.7.1)

reduce_freq: Reduce the frequency of the time series data in a data.table

Description

In a time series dataset, there is a time difference between one row and the next one. This function reduces the number of rows from its current frequency to the desired one. Instead of the frequency in Hz, the number of seconds between rows is asked (Hz = 1/s).

Usage

reduce_freq(dt, obj_freq, curr_freq, id_var = NULL)

Arguments

dt

the original data.table

obj_freq

the desired number of seconds between rows

curr_freq

the number of seconds between rows in the original dataset

id_var

optional variable that labels different time series in a dataset, to avoid averaging values from different processes

Value

the data.table with the desired frequency