Fills NA values at the beginning and end of a signal that may result from filtering operations.
Usage
fillEdgeNA(x, method = c("extend", "zero"))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.
Examples
x <- c(NA, NA, 1, 2, 3, NA, NA)
fillEdgeNA(x, method = "extend")
#> [1] 1 1 1 2 3 3 3