Vignettes and other documentation
Vignettes from package 'permute'
permute::permutations
Restricted permutations; using the permute package
PDF
source
R code