Hi Eliza,
It sure was:
YY$datetime<-strptime(YY$TIMESTAMP,"%Y/%m/%d %I:%M:%S %p")
dt5min<-seq(ISOdate(2021,5,1,0,5),ISOdate(2021,5,31,12,55),by="5 min")
newdt<-data.frame(datetime=dt5min)
newyy<-merge(newdt,YY,by="datetime",all=TRUE)
newyy$RAINFALL[is.na(newyy$RAINFALL)]<-0
plot(newyy$datetime,new
There are quite a variety of approaches implemented in various contributed
packages, but here is a base R approach based on merge:
Sys.setenv(TZ = "UTC" ) # or other non-DST zone unless you need it
YY$TIMESTAMP <- as.POSIXct( YY$TIMESTAMP, format = "%Y/%m/%d %I:%M:%S %p" )
tlims <- as.POSIXct( c(
2 matches
Mail list logo