'I want to do locf imputation grouping by date and with the condition of a specific time interval
I have data over time referred to intervals of 15 minutes but which are not regular.I would like to make a locf imputation by putting in place of each NA the first value available on that day but only if it falls within the immediately preceding hour.
I have this type of data: enter image description here
and I want to have this result: enter image description here
My code is: enter image description here
but I don't know how to have the condition of imputation in the interval of an hour. Can you help me?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
