Hankin, R. K. S., and L. J. West. “Set Partitions in R”. Journal of Statistical Software, Code Snippets, vol. 23, no. 2, Dec. 2007, pp. 1-12, doi:10.18637/jss.v023.c02.