I am blocked in my analysis
I have a dataset like this one:
Date | Light |
---|---|
2019-02-15 01:00:00 | 0.134 |
2019-02-15 02:00:00 | 0.345 |
2019-02-15 03:00:00 | 0.567 |
2019-02-15 04:00:00 | 0 |
2019-02-15 05:00:00 | 0.100 |
... | ... |
2019-03-10 15:00:00 | 0.890 |
... | ... |
It's a big dataset with lots of dates. And I'm trying to get the light averages for different periods of time: daily average; 5-day average; 1-week average (last 4 days + today ; the last 6 days + today and the daily average)
the results i would like to have are like this dataset :
Date | Light | timeperiod_5days | timeperiod_1week | timeperiod_24h |
---|
I tried to use differents function : timeAverage; xts. but I can't get any results, I don't know if they are suitable for what I want.
Someone know how i can obtain my results ?
Thanks in Advance !