gavinsimpson / permute

Restricted permutations
https://gavinsimpson.github.io/permute/
GNU General Public License v2.0
23 stars 4 forks source link

ShuffleSet Accepts Only Number of Observations as Input #33

Open DarioS opened 1 year ago

DarioS commented 1 year ago

It would be desirable to allow a vector of characters to permute and avoid needing to recode the result from indices to values.

gavinsimpson commented 1 year ago

I don't want to alter shuffle() or shuffleSet() to do this, but I could add a permutations() that would do what you wanted (internally call shuffleSet() and then us the set of permutations to index the supplied vector). Would that suffice?

DarioS commented 1 year ago

Ah, yes, you wouldn't want to change the API of shuffleSet to keep compatibility with existing uses of it.