R/zlag.R

Defines functions zlag

Documented in zlag

#' @export 
zlag <-
function (x, d = 1) 
{
    if (d != as.integer(d) || d < 0) 
        stop("d must be a non-negative integer")
    if (d == 0) 
        return(x)
    else return(c(rep(NA, d), rev(rev(x)[-(1:d)])))
}

Try the TSA package in your browser

Any scripts or data that you put into this service are public.

TSA documentation built on July 2, 2018, 1:04 a.m.