Skip to main content

builtin_combn

Function builtin_combn 

Source
fn builtin_combn(
    args: &[RValue],
    _: &[(String, RValue)],
) -> Result<RValue, RError>
Expand description

All combinations of n elements taken k at a time.

Returns a matrix with k rows and choose(n, k) columns, where each column is one combination.

@param x if numeric scalar, treated as 1:x; if vector, elements to combine @param m number of elements to choose @return matrix of combinations (k rows, choose(n,k) columns)