na_seasplit
instead.na.seasplit is replaced by na_seasplit
.
The functionality stays the same. The new name better fits modern R code
style guidelines (which prefer _ over . in function names).
na.seasplit(
x,
algorithm = "interpolation",
find_frequency = FALSE,
maxgap = Inf,
...
)
Numeric Vector (vector
) or Time Series (ts
)
object in which missing values shall be replaced
Algorithm to be used after splits. Accepts the following input:
"interpolation" - Imputation by Interpolation (default choice)
"locf" - Imputation by Last Observation Carried Forward
"mean" - Imputation by Mean Value
"random" - Imputation by Random Sample
"kalman" - Imputation by Kalman Smoothing and State Space Models
"ma" - Imputation by Weighted Moving Average
If TRUE the algorithm will try to estimate the frequency of the time-series automatically.
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 for these algorithms that can be
passed through. Look at na_interpolation
,
na_locf
, na_random
,
na_mean
for parameter options.