perms {lca} | R Documentation |
Produces a list of possible permutations of n
integers subject to restrictions.
perms(n, pattern = rep(1, n))
n |
the number of integers to permute. |
pattern |
pattern of restrictions. |
If the i
th and j
th positions of pattern
differ, then permutations of i
and j
are not included.
A matrix, each row of which is a permutation of 1:n
.
Robin Evans
perms(4) # Permute two components (c(1,3) and c(2,4,5) separately) perms(5, c(1,2,1,2,2))