# Interpolate a vector time series and highlight the imputed data
chl27 <- sfbayChla[, 's27']
x1 <- interpTs(chl27, gap = 3)
plot(x1, col = 'red')
lines(chl27, col = 'blue')
# Interpolate a matrix time series and plot results
x2 <- interpTs(sfbayChla, gap = 1)
plot(x2[, 1:10], main = "SF Bay Chl-a
(gaps of 1 month interpolated)")Run the code above in your browser using DataLab