permute
permute copied to clipboard
Add a `permutations()` function
This would take a supplied vector to be permuted, the control, and the number of permutations, and then return that vector permuted according to each permutation. See #33
What about the case when all different permutations are not distinct? Say, you have one factor variable and all permutations within factor level are equal. For instance, the Management
variable in the dune.env
data of vegan has these class counts:
BF HF NM SF
3 5 6 6
which would give
> choose(20,3) * choose(17,5) * choose(12,6)
[1] 6518191680
distinct permutations against formal 20! = 2.43 × 1018.
This has been asked sometimes. On the other hand, having only distinct permutations can be regarded as biased, as these combinations of classes are not equally frequent in terms of free permutation of elements.