Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

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

Examples

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

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.