R/ma.R

.ma <- function(x, n.p) {
   if(is.null(x) || !is.numeric(n.p))
      stop("something is wrong with the specified parameters")

   n <- length(x)
   out <- .C("ma", as.double(x), as.integer(n), as.integer(n.p), ans=double(n - 2*n.p), PACKAGE="stl2")
   return(out$ans)
}
hafen/stl2 documentation built on May 17, 2019, 2:23 p.m.