consec_pairs: Generate a matrix of consecutive elements

Description Usage Arguments Value

View source: R/consec_pairs.R

Description

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

Usage

1
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 Feb. 10, 2021, 5:06 p.m.