pair_matrix {cape} | R Documentation |
Get all pairs of elements in a vector
Description
This function makes a matrix with two columns listing all pairwise combinations of the elements of the input vector.
Usage
pair_matrix(elements, ordered = FALSE, self_pairs = FALSE)
Arguments
elements |
a vector containing elements from which to draw all possible pairs. Can be numeric or strings |
ordered |
A logical value indicating whether the order of the pairs is important. If TRUE both a,b and b,a will be returned. If FALSE, only a,b will be returned. |
self_pairs |
A logical value indicating whether self pairs should be included. If TRUE, a,a will be returned. Otherwise it will be excluded. |
Value
A two-column matrix containing pairs of entries in elements.
[Package cape version 3.1.2 Index]