kin.sgFilter | R Documentation |
Applies a Savitzky-Golay smoothing filter to a numeric vector, with built-in handling for NA values. This function wraps the sgolayfilt function from the 'signal' package.
kin.sgFilter(x, p = 4, m = 0, ts = 1)
x |
Numeric vector to be filtered |
p |
Integer indicating the order of the polynomial used to fit the data (default: 4) |
m |
Integer indicating the order of derivatives to calculate (default: 0) |
ts |
Numeric value for the sampling interval (default: 1) |
A numeric vector of the same length as the input, containing the filtered values
## Not run:
data <- c(1, 2, NA, 4, 5, 6)
filtered_data <- kin.sgFilter(data)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.