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).
reduce_freq(dt, obj_freq, curr_freq, id_var = NULL)
the original data.table
the desired number of seconds between rows
the number of seconds between rows in the original dataset
optional variable that labels different time series in a dataset, to avoid averaging values from different processes
the data.table with the desired frequency