kin.sgFilter: Apply Savitzky-Golay Filter

View source: R/kin.sgFilter.r

kin.sgFilterR Documentation

Apply Savitzky-Golay Filter

Description

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.

Usage

kin.sgFilter(x, p = 4, m = 0, ts = 1)

Arguments

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)

Value

A numeric vector of the same length as the input, containing the filtered values

Examples

## Not run: 
data <- c(1, 2, NA, 4, 5, 6)
filtered_data <- kin.sgFilter(data)

## End(Not run)


ccamp83/kinesis documentation built on July 4, 2025, 6:19 p.m.