I do have 2 datasets per 10 minutes on 34 years. In one of them, observations are made only every 3 hours and I would like to keep only the lines with those observations. It starts at midnight (included) and goes like: 3am, 6am, 9am etc.
Looks like this:
stn CODES time1 pcp_type
1 SIO - 1981-01-01 02:00:00 <NA>
2 SIO - 1981-01-01 02:10:00 <NA>
3 SIO - 1981-01-01 02:20:00 <NA>
4 SIO - 1981-01-01 02:30:00 <NA>
5 SIO - 1981-01-01 02:40:00 <NA>
6 SIO - 1981-01-01 02:50:00 <NA>
Now the idea would be to keep only lines which corresponds to every 3 hours and deleting the rest.
I saw some solution about sorting by value (e.g. is bigger than) but I didn't find a solution that could help me sort by hour ( %H == 3 etc).
Thank you in advance.
I've already sorted my time column as following:
SYNOP_SION$time1<-as.POSIXct(strptime(as.character(SYNOP_SION$time),format = "%Y%m%d%H%M"), tz="UTC")