getPermutations | R Documentation |
The function arranges, in an optimized way, all the elements of a set into a selected number of different sequences (i.e., permutations). If the number of possible orderings is less than the required number, the function returns the collection of all possible permutations.
getPermutations(n, nperms)
n |
number of elements |
nperms |
number of required permutations |
The function returns:
perms
: a matrix with nperms
rows and n
columns, containing the sequence of the ordered elements
all.perms.flag
: 1
if the perms array contains the entire collection of permutations, 0
otherwise. In the first case, the number of rows of perms
matrix may be less than the number of requested permutations
nperms.act
: the number of permutations returned
sub.perm<-getPermutations(10,100) all.perm<-getPermutations(3,100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.