imputeTS (version 3.3)

na.interpolation: Deprecated use na_interpolation instead.


na.interpolation is replaced by na_interpolation. The functionality stays the same. The new name better fits modern R code style guidelines (which prefer _ over . in function names).


na.interpolation(x, option = "linear", maxgap = Inf, ...)



Numeric Vector (vector) or Time Series (ts) object in which missing values shall be replaced


Algorithm to be used. Accepts the following input:

  • "linear" - for linear interpolation using approx (default choice)

  • "spline" - for spline interpolation using spline

  • "stine" - for Stineman interpolation using stinterp


Maximum number of successive NAs to still perform imputation on. Default setting is to replace all NAs without restrictions. With this option set, consecutive NAs runs, that are longer than 'maxgap' will be left NA. This option mostly makes sense if you want to treat long runs of NA afterwards separately.


Additional parameters to be passed through to approx or spline interpolation functions