R/savgol.R

Defines functions savgol

Documented in savgol

savgol <- function(X, m, n, p, ts = 1) {
    
    X <- .matrix(X)
    dimnam <- dimnames(X)
    
    X <- t(apply(X, MARGIN = 1, 
        FUN = signal::sgolayfilt, n = n, p = p, m = m, ts = ts))

    dimnames(X) <- dimnam
    
    X
    
    }
mlesnoff/rnirs documentation built on April 24, 2023, 4:17 a.m.