One column with time and date values, and the other with values of speed, I would like to interpolate the value of speed for any given time as below, but I am getting an error.
This is the data set.
startTimestamp avg_Speed
2016-04-11 00:01:07 74.45
2016-04-11 00:05:10 73.58
2016-04-11 00:06:09 89.90
I want to interpolate the value of speed at say - "00:03:11", I just used the spline function as so,
newspeed <- splinefun(k$startTimestamp, k$avg_Speed, method = "monoH.FC")
newspeed("00:03:11")
And this is the error I get.
Error in if (extrapol == "linear" && any(iXtra <- (iL <- (i == 0)) | (iR ...
Some additional information: class(f$startTimestamp) = "POSIXct" "POSIXt"