I have an R tibble which has a Time column in the following format: "2020-08-19 07:59:05 IDT" I want to create an additional column that makes some aggregation function but in the scope of the time frame, for example I have an additional column Amount and I want to create an additonal column that for each row sum all the amount from the previous 10 sec.
Time Amount. SumOverTime(10 sec)
1 2020-08-19 07:57:18 0. 0
2 2020-08-19 07:57:19 1. 1
3 2020-08-19 07:57:19 1. 2
4 2020-08-19 07:57:20 0. 2
5 2020-08-19 07:57:20 2. 4
6 2020-08-19 07:57:20 0. 4
7 2020-08-19 07:57:21 0. 4
8 2020-08-19 07:57:22 0. 4
9 2020-08-19 07:57:23 1. 5
10 2020-08-19 07:57:28 0. 5
11 2020-08-19 07:57:30 0. 3
12 2020-08-19 07:57:31 0. 1
13 2020-08-19 07:57:32 0. 1
Thanks for the help!