Provides various strategies for handling NA values in signal data.
Usage
handleNA(
x,
method = c("interpolate", "omit", "zero", "mean", "locf", "none"),
...
)References
Oostenveld R, Fries P, Maris E, Schoffelen JM (2011). "FieldTrip: Open source software for advanced analysis of MEG, EEG, and invasive electrophysiological data." Computational Intelligence and Neuroscience, 2011, 156869.
See also
replaceNA for handling NA in PhysioExperiment assays,
fillEdgeNA for edge-specific NA filling,
checkNA for NA validation
Examples
x <- c(1, NA, 3, NA, 5)
# Linear interpolation
handleNA(x, method = "interpolate")
#> [1] 1 2 3 4 5
# Replace with mean
handleNA(x, method = "mean")
#> [1] 1 3 3 3 5
# Last observation carried forward
handleNA(x, method = "locf")
#> [1] 1 1 3 3 5