consec_pairs {cape} | R 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.
[Package cape version 3.1.2 Index]