I have two data frames: one that includes data by day, and one that includes data at irregular multi-day time intervals. For instance:
Data frame precip_rangewith precipitation data at irregular time intervals:
start_date<-as.Date(c("2010-11-01", "2010-11-04", "2010-11-10"))
end_date<-as.Date(c("2010-11-03", "2010-11-09", "2010-11-12"))
precipitation<-(c(12, 8, 14))
precip_range<-data.frame(start_date, end_date, precipitation)
And a data frame precip_dailywith daily precipitation data:
day<-as.Date(c("2010-11-01", "2010-11-02", "2010-11-03", "2010-11-04", "2010-11-05",
"2010-11-06", "2010-11-07", "2010-11-08", "2010-11-09", "2010-11-10",
"2010-11-11", "2010-11-12"))
precip<-(c(3, 1, 2, 1, 0.25, 1, 3, 0.33, 0.75, 0.5, 1, 2))
precip_daily<-data.frame(day, precip)
In this example, precip_dailyrepresents the daily rainfall estimated by the model and precip_rangerepresents the measured cumulative precipitation for specific date ranges. I am trying to compare the simulated with the measured data, which requires synchronization of time periods.
, precip precip_daily ( precip) start_date end_date precip_range. ?