View source: R/permutation_combination.R
All k possible combinations from n elements | R Documentation |
All k possible combinations from n elements.
comb_n(n, k,simplify=TRUE)
n |
A positive INTEGER number or a vector with numbers. |
k |
A positive integer number at most equal to n or at most equal to the length of n, if n is a vector. |
simplify |
A logical value for return List instead of matrix. |
A matrix with k columns and rows equal to the number of possible unique combinations of n with k elements. If simplify is set to TRUE then a list with k values where each value has length equal to the number of possible unique combinations of n with k elements.
Manos Papadakis and Marios Dimitriadis
R implementation and documentation: Manos Papadakis <papadakm95@gmail.com> and Marios Dimitriadis <kmdimitriadis@gmail.com>.
Nijenhuis A. and Wilf H.S. (1978). Combinatorial Algorithms for Computers and Calculators. Academic Press, NY.
nth, colMaxs, colMins, colrange
comb_n(20, 4)
combn(20, 4)
x <- rnorm(5)
res<-comb_n(x, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.