Combination.r
API
- count all combinations without the permutation (計算不考慮排列下所有組合的數目)
numeric getAllCombinationNumber(
numeric SetNum,
numeric selectedNum
)
- return the combination set based on the order of the set (計算不考慮排列下所有組合的數目)
vector getCombination(
vector getSet,
numeric getNum,
numeric getWhichCombination
)
- return the random combination set as a matrix
matrix getRandomSet(
vector eleColl,
numeric eleCountInSet,
numeric getTtlSetNum,
logical retByIndex
)
Example
allCombNumber <- getAllCombinationNumber(80,4)
getEleSet <- getCombination(c('a','b','c','d','e'),3,7)
getRandomSet(c('a','b','c','d','e'),3,2,FALSE)