nChooseK | R Documentation |
Given 'n' elements and combinations of size 'k', find number of unique combinations.
nChooseK(n_v, k_v)
n_v |
number of possible elements to create combinations |
k_v |
size of combinations (e.g. 3 means all unique combinations of 3 elements from n_v) |
numeric vector listing the total number of combinations
set.seed(1)
n_v <- sample(1:50, size = 5)
k1_v <- 3; k2_v <- 5
nChooseK(n_v[1], k1_v)
nChooseK(n_v[1], k2_v)
nChooseK(n_v, k1_v)
nChooseK(n_v, k2_v)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.