R/fill.R

# fill gaps in a time series
fill = function(indat) {
  idx = which(is.na(indat))
  outdat = indat
  outdat[idx] = approx(1:length(indat),indat,xout=idx)$y
  cat(paste(length(idx),'out of',length(indat),'filled.\n'))
  return(outdat)
}

Try the RHydro package in your browser

Any scripts or data that you put into this service are public.

RHydro documentation built on May 2, 2019, 6:24 p.m.