I have a list of dates for 1985 (hourly): for each day there is 24 hours. My object is fg
, here's an example:
fg
"1985-01-01 00:30:00 GMT" to "1985-01-01 22:30:00 GMT" then NA # (NA here should be "1985-01-01 23:30:00 GMT")
"1985-01-02 00:30:00 GMT" to "1985-01-02 22:30:00 GMT" then NA # (NA here should be "1985-01-02 23:30:00 GMT ")
"1985-01-03 00:30:00 GMT" to "1985-01-03 22:30:00 GMT" then NA
"1985-01-04 00:30:00 GMT" to "1985-01-04 22:30:00 GMT" then NA
str(fg)
POSIXct[1:8760], format: "1985-01-01 00:30:00" "1985-01-01 01:30:00"
class(fg)
[1] "POSIXct" "POSIXt"
the last hour 23:30:00
is missing in each day so I want here to replace NA
with last hour of that day.