generate_all_combinations: Function to generate all combinations of the elements within...

View source: R/generate_all_combinations.R

generate_all_combinationsR Documentation

Function to generate all combinations of the elements within a vector.

Description

Function to generate all combinations of the elements within a vector.

Usage

generate_all_combinations(x)

Arguments

x

A vector to generate all combinations of elements of.

Value

List, with the length of 2 ^ length(x) - 1.

Author(s)

Stuart K. Grange

See Also

combn

Examples


# Get all combinations of three letters
letters <- c("s", "t", "u")
generate_all_combinations(letters)


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.