DescTools (version 0.99.8.1)

Permn: Determine All Possible Permutations of a Set

Description

Return the set of permutations for a given set of values. The values can be numeric values, characters or factors.

Usage

Permn(x, sort = FALSE)

Arguments

x
a vector of numeric values or characters. Characters need not be unique.
sort
logical, defining if the result set shouldb be sorted. Default is FALSE.

Value

  • a data.frame with all possible permutations of the values in x.

Details

The vector x need not contain unique values. The permutations will automatically be filtered for unique sets, if the same element is given twice or more.

See Also

combn, choose, factorial, GetAllSubsets

Examples

Run this code
Permn(letters[2:5])
Permn(2:5)

Permn(c("a","b","c","a"))

Run the code above in your browser using DataLab