perms(4)
summary(perms(5))
# Knuth's Figure 18:
matplot(t(apply(plainperms(4),2,order)),
type='l', lty=1, lwd=5, asp=1,
frame=FALSE, axes=FALSE, ylab="", col=gray((1:5)/5))
Run the code above in your browser using DataCamp Workspace