Skip to contents

Computation of number of combinations/permutations.

Usage

calc_combination(n, r, order_matter = FALSE, with_repetition = FALSE)

Arguments

n

A numeric single value, that will be the total number of observations

r

A numeric single value, that will be the number of observations to be selected

order_matter

A boolean value, if TRUE the function will be a permutation, if not a combination (default = FALSE)

with_repetition

A boolean value, if TRUE the function will consider that there will be repetitions (default = FALSE)

Value

A numeric single value.

Examples


calc_combination(6,2)
#> [1] 15

calc_combination(6,2,order_matter = TRUE,with_repetition = TRUE)
#> [1] 36