consec_pairs: Generate a matrix of consecutive elements

View source: R/consec_pairs.R

consec_pairsR Documentation

Generate a matrix of consecutive elements

Description

Given a vector, this function generates a two-column matrix in which each row contains an element and its consecutive neighbor.

Usage

consec_pairs(elements)

Arguments

elements

a vector of elements

Value

a matrix with two columns. The first column is identical to elements with the last element taken off. And second column holds the next consecutive element.


TheJacksonLaboratory/CAPE documentation built on Feb. 12, 2024, 4:32 p.m.