combinadic: i-th combination of n elements taken from r

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/auxiliar.R

Description

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.

Usage

1
combinadic(n, r, i)

Arguments

n

Elements to extract the combination from

r

Number of elements per combination

i

ith combination

Value

The combination ith of the elements

Author(s)

Joshua Ulrich

References

StackOverflow answer 4494469/2886003

See Also

combn

Examples

1
2
3
4
#Output of all combinations
combn(LETTERS[1:5], 2)
# Otuput of the second combination
combinadic(LETTERS[1:5], 2, 2)

Bioconductor-mirror/BioCor documentation built on May 29, 2017, 12:07 a.m.