permute
permute copied to clipboard
ShuffleSet Accepts Only Number of Observations as Input
It would be desirable to allow a vector of characters to permute and avoid needing to recode the result from indices to values.
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?
Ah, yes, you wouldn't want to change the API of shuffleSet
to keep compatibility with existing uses of it.