randcomb: Random Combination

View source: R/combs.R

randcombR Documentation

Random Combination

Description

Generates a random combination.

Usage

randcomb(a, m)

Arguments

a

numeric vector of some length n

m

integer with 0 <= m <= n

Details

Generates one random combination of the elements a of length m.

Value

vector of combined elements of a

Note

This behavior is different from Matlab/Octave, but does better correspond with the behavior of the perms() function.

See Also

combs, randperm

Examples

randcomb(seq(2, 10, by=2), m = 3)

pracma documentation built on Nov. 10, 2023, 1:14 a.m.