pair_matrix | R Documentation |
This function makes a matrix with two columns listing all pairwise combinations of the elements of the input vector.
pair_matrix(elements, ordered = FALSE, self_pairs = FALSE)
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. |
A two-column matrix containing pairs of entries in elements.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.