Last chance! 50% off unlimited learning
Sale ends in
Find the "next" or "previous" values in a matrix.
mat.lag(m, n = 1L, default = NA)mat.lead(m, n = 1L, default = NA)
a matrix of values
a positive integer of length 1, giving the number of positions to lead or lag by
value used for non-existent rows. Defaults to NA.
# NOT RUN {
m <- matrix(1:120, ncol = 12)
mat.lag(m)
mat.lead(m)
# }
Run the code above in your browser using DataLab