Learn R Programming

iterpc (version 0.2.8)

nc_multiset: Calculate the number of r-combinations of a multiset

Description

Calculate the number of r-combinations of a multiset

Usage

nc_multiset(f, r)

Arguments

f
the frequencies of the mutliset
r
the number of object drawn from the multiset

Value

  • the number of combinations

Examples

Run this code
x <- c("a","a","b")
# possible combinations of size 2 are "aa" and "ab".
nc_multiset(table(x), 2) # <- 2

Run the code above in your browser using DataLab