I would like to add all missing dates between min and max date in a data.frame and linear interpolate all missing values, like
data.frame
df <- data.fra
I think your code would look much clear and simple if you use Forecast package.
library(forecast) x <- zoo(df$value,df$date) x <- as.ts(x) x <- na.interp(x) print(x)