nPr | R Documentation |
Calculates the number of ordered arrangements in which no element occurs more than once, without the requirement of using all the elements from a given set. Also known as partial permutations or as sequences without repetition.
nPr(n, r)
n |
An integer number of elements to permute. May be a vector if |
r |
An integer subgroup size. May be a vector if |
Implements the equation
n! / (n - r)!
A named vector containing the integer number of possible permutations for each value of n
supplied.
## Not run: nPr(3, 2) nPr(3:5, 2) nPr(5, 2:4) nPr(1:5, 3) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.