Learn R Programming

pracma (version 1.7.0)

randcomb: 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

Value

  • vector of combined elements of a

Details

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

See Also

combs, randperm

Examples

Run this code
randcomb(seq(2, 10, by=2), m = 3)

Run the code above in your browser using DataLab