View source: R/permutation_combination.R
Permutation | R Documentation |
Permute the given vector.
permutation(x, nperm = gamma(length(x)+1))
permutation.next(x, nperm = gamma(length(x)+1))
permutation.prev(x, nperm = gamma(length(x)+1))
bincomb(n)
x |
A numeric vector with data. |
nperm |
An integer value for returning specific number of combinations. By defualt is set to all combinations. Must be between 0<=nperm<=gamma(length(x)+1) |
n |
An integer value for the length of the binary number. |
This function implements "Permutation", which means all the possible combinations. In the permutation.next and permutation.prev if there aren't possible combinations it returns the same vector. "Binary Combinations" for "bincomb", means all the possible combinations for the binary number with length "n".
Returns a matrix with all possible combinations of the given vector or a matrix row with one possible combinations.
Manos Papadakis
R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>
combn,comb_n
y <- rnorm(3)
b <- permutation(y)
b <- permutation.next(y)
b <- permutation.prev(y)
g <- bincomb(3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.