The Combinations package
This package provides a very simple facility
which is to compute all of the n choose r combinations
from selecting r items from a set of n elements.
This is useful in sampling, probability, etc.
The package also illustrates one approach to
handling very large vectors of data
that are generated dynamically.
The code is adapted from Glen Rhoads' code at, originally at
The package also serves as a relatively simple
example of how to
- interface from R to C;
- call R functions from C;
- adapt C code for a stand-alone application to be used
in a language like R/S-Plus, Matlab, Perl, Python; and
- simple use of S4 classes for functions.
You can install this for R using the R command
(i.e. within an R session)
install.packages("Combinations", repos = "http://www.omeghat.org/R")
Alternatively, download the source
and install it using
R CMD INSTALL Combinations_0.2-0.tar.gz
or use the binary version.
Duncan Temple Lang
Last modified: Tue Mar 2 21:45:53 PST 2010