This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# it is a tutorial to generate permuations/combinations using `partitions`, `gtools` and `multicool`. | |
# mainly for reference only, consider the package `iterpc` in practice. | |
library(partitions) | |
library(gtools) | |
library(multicool) | |
1) combinations: without replacement: distinct items | |
n = 5; r = 3 | |
combn(n, r) |