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)
A two-column matrix containing pairs of entries in elements.
a vector containing elements from which to draw all possible pairs. Can be numeric or strings
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.
A logical value indicating whether self pairs should be included. If TRUE, a,a will be returned. Otherwise it will be excluded.