I have two series of data (calibration and sample) and am trying to interpolate the calibration data from monthly to the frequency of the sample which randomly changes between m
If your data-set is already formatted as date-time you don't need to struggle with using zoo
. Here, I simply used approx
function and it gave me exactly what I wanted. You can get the data-set from the question to reproduce the code.
ipc <- approx(calib$Date,calib$MW2, xout = sample$`DateMW-2`,
rule = 1, method = "linear", ties = mean)
You can see that the data is being interpolated linearly between the given data points.
Thanks for your insightful comments.