I have two sets of data with different time stamps. One set of data contains calibration data, the other contains sample data. The calibration is much less frequent than the samples.
What I would like to do is interpolate the calibration data (low freq) onto the sample time series (high freq).
sam <- textConnection("time, value
01:00:52, 256
01:03:02, 254
01:05:23, 255
01:07:42, 257
01:10:12, 256")
cal <- textConnection("time, value
01:01:02, 252.3
01:05:15, 249.8
01:10:02, 255.6")
sample <- read.csv(sam)
sample$time <- as.POSIXct(sample$time, format="%H:%M:%S")
calib <- read.csv(cal)
calib$time <- as.POSIXct(calib$time, format="%H:%M:%S")
The big problem (that I see) is that the freq of the data changes randomly.
Have any of you had to do similar things? Is there a chron or zoo function which would do what I want (interpolate low freq data onto higher freq data where both ts are random)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…