How to calculate combination and permutation in R?
If you don't want your code to depend on other packages, you can always just write these functions:
perm = function(n, x) {
factorial(n) / factorial(n-x)
}
comb = function(n, x) {
factorial(n) / factorial(n-x) / factorial(x)
}
The function combn is in the standard utils package (i.e. already installed)
choose is also already available in the Special {base}