Learn R Programming

iterpc (version 0.2.6)

np_multiset: Calcuate the number of r-permutations of a multiset

Description

Calcuate the number of r-permutations of a multiset

Usage

np_multiset(f, r)

Arguments

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

Value

  • the number of r-permutations

Examples

Run this code
x = c("a","a","b")
# possible permutations of size 2 are "aa", "ab" and "ba".
np_multiset(table(x), 2) # = 3

Run the code above in your browser using DataLab