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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.