permutation: Two-item permutations

Description Usage Arguments See Also Examples

Description

Returns a vector of all possible 2-item permutations for elements in a vector

Usage

1
permutation(x, repeats = FALSE)

Arguments

x

A vector or an R object, which is coercible to one by as.vector(x, "numeric")

repeats

logical. Can elements combine with themselves?

See Also

combn A function that executes this much better

expand.grid

Examples

1
permutation(x = c("a", "b", "c"), repeats = TRUE)

opelr/opelR documentation built on May 3, 2019, 5:49 p.m.