daqana / dqrng

Fast Pseudo Random Number Generators for R
https://daqana.github.io/dqrng/
Other
42 stars 8 forks source link

All possible permutations #37

Closed Mthrun closed 4 years ago

Mthrun commented 4 years ago

I got a hint that this package has a sampling function. In the documentation it is stated, that it can be used for the purpose of permutation. Is there a shortcut to compute all possible permutations given an numerical vector vec, e.g. allPossiblePermutations <- pracma::perms(vec)

This would be very helpful for my purposes.

rstub commented 4 years ago

The help page for dqsample is modeled after the help page for sample. In both cases, the "Random Samples and Permutations", should be understood as "Random Samples and Random Permutations". So no, there is no function in dqrng to create all permutations, and I would consider it out-of-scope for this package, but you can easily get random permutations. Whats wrong with pracma::perms?