combinadic | R Documentation |
Function similar to combn but for larger vectors. To avoid allocating a big vector with all the combinations each one can be computed with this function.
combinadic(n, r, i)
n |
Elements to extract the combination from |
r |
Number of elements per combination |
i |
ith combination |
The combination ith of the elements
Joshua Ulrich
StackOverflow answer 4494469/2886003
combn()
# Output of all combinations
combn(LETTERS[1:5], 2)
# Otuput of the second combination
combinadic(LETTERS[1:5], 2, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.