I would like to perform rolling calculations on this dataset based on the datetime column. Let's say I want to create another column with a mean value with a rolling window of 5sec. What is the most efficient way to perform this?
So far I came up with a three-step solution - first extract 1st and last datetime value. Then create a datetime vector containing every second between 1st and last value. Then join it with the original dataset & perform rolling calcs. Is there any way how to perform all this in a single %>%? Or is there even an more elegant solution to this?