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.


cape documentation built on May 20, 2022, 1:06 a.m.