Learn R Programming

StratigrapheR (version 0.0.2)

mat.lag: Find the "next" or "previous" values in a matrix.

Description

Find the "next" or "previous" values in a matrix.

Usage

mat.lag(m, n = 1L, default = NA)

mat.lead(m, n = 1L, default = NA)

Arguments

m

a matrix of values

n

a positive integer of length 1, giving the number of positions to lead or lag by

default

value used for non-existent rows. Defaults to NA.

Examples

Run this code
# NOT RUN {
m <- matrix(1:120, ncol = 12)

mat.lag(m)
mat.lead(m)

# }

Run the code above in your browser using DataLab