na_seasplit | R Documentation |
Splits the times series into seasons and afterwards performs imputation separately for each of the resulting time series datasets (each containing the data for one specific season).
na_seasplit( x, algorithm = "interpolation", find_frequency = FALSE, maxgap = Inf, ... )
x |
Numeric Vector ( |
algorithm |
Algorithm to be used after splits. Accepts the following input:
|
find_frequency |
If TRUE the algorithm will try to estimate the frequency of the time-series automatically. |
maxgap |
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 |
Vector (vector
) or Time Series (ts
)
object (dependent on given input at parameter x)
Steffen Moritz
na_interpolation
,
na_kalman
, na_locf
,
na_ma
, na_mean
,
na_random
, na_replace
,
na_seadec
# Example 1: Perform seasonal splitted imputation using algorithm = "interpolation" na_seasplit(tsAirgap, algorithm = "interpolation") # Example 2: Perform seasonal splitted imputation using algorithm = "mean" na_seasplit(tsAirgap, algorithm = "mean") # Example 3: Same as example 1, just written with pipe operator tsAirgap %>% na_seasplit(algorithm = "interpolation")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.