Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a permutations() function #35

Open
gavinsimpson opened this issue Dec 19, 2022 · 1 comment
Open

Add a permutations() function #35

gavinsimpson opened this issue Dec 19, 2022 · 1 comment

Comments

@gavinsimpson
Copy link
Owner

gavinsimpson commented Dec 19, 2022

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

@jarioksa
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants