Say, if I have a data frame as follows:
Date1 <- seq(from = as.POSIXct(\"2010-05-01 02:00\"), to = as.POSIXct(\"2010-10-10 22:00\"), by = 36
Create new data frame that contains all hours and then merge both data frames.
df2<-data.frame(DateTime=seq(from = as.POSIXct("2010-01-01 00:00"), to = as.POSIXct("2010-12-31 23:00"), by = "hour")) merge(df2,Dat,all=TRUE)