From this hourly data, I need to find the value of NA, calculating the average Temp of the previous day and the next day at the same time (1200).
The data format is as follows: Where n is the day number of the year. The time is raw (0 = 00:00, 100 = 1:00, etc).
Date | n | hour | temperature |
---|---|---|---|
09/01/2016 | 9 | 600 | 8.4 |
09/01/2016 | 9 | 700 | 8.2 |
09/01/2016 | 9 | 800 | 7.8 |
09/01/2016 | 9 | 900 | 8.7 |
09/01/2016 | 9 | 1000 | 13.6 |
09/01/2016 | 9 | 1100 | 16.6 |
09/01/2016 | 9 | 1200 | 19.7 |
01/10/2016 | 10 | 1200 | NA |
01/11/2016 | eleven | 1200 | 18.9 |
01/11/2016 | eleven | 1300 | 20.9 |
01/11/2016 | eleven | 1400 | 23.3 |
01/11/2016 | eleven | 1500 | 24.3 |
There are many NAs in different periods, so I am trying to obtain a code that allows me to calculate the averages of the day before and after the hour where there is an NA.
Thank you