R/gap-filling.R

# gap filling strategies

#===============================================================================
# Weather variables and/or very short gaps

#' Fills missing values in a column using linear interpolation
#' 
#' @return A time series in which the column col has no NAs
fill_col <- function(tse, col) {
  # interpollate the missing values
  r <- approx(x = tse$time.local, y = tse[, col], 
         xout = tse$time.local) 
  
  # return a column with no missing values
  r$y
}
EBlonkowski/timeseries documentation built on May 6, 2019, 2:57 p.m.