R/laggedMatrix.R

Defines functions laggedMatrix

Documented in laggedMatrix

laggedMatrix <- function(x, k) {
  L <- length(x+k)
  z <- matrix(NA, nrow = L + k - 1, ncol = k)
  for (i in 1:k) {
    z[(1:L) + (i - 1), i] <- x
  }
  return(z)
}

Try the simecolUtil package in your browser

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

simecolUtil documentation built on May 2, 2019, 5:57 p.m.