R/zlag.R

#' @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 5, 2022, 5:05 p.m.