pset: Powerset Function to return the powerset for a numeric or...

psetR Documentation

Powerset Function to return the powerset for a numeric or character vector of set elements, with options for filtering sets by setlength. Changing min.length or max.length arguments from default values produces a subset of the powerset.

Description

Powerset

Function to return the powerset for a numeric or character vector of set elements, with options for filtering sets by setlength. Changing min.length or max.length arguments from default values produces a subset of the powerset.

Usage

pset(x, min.length = 0, max.length = NULL)

Arguments

x

Numerical or character vector

min.length

Minimum length of a set to return the set. Default = 0, therefore the NULL set is included by default.

max.length

Maximum length of a set to return the set. Default = NULL, meaning any set at least as large as min.length will be returned.

Value

List with powerset of x, or a subset of the powerset if min.length != 0 and/or max.length != NULL.


JeffWeinell/misc.wrappers documentation built on Sept. 20, 2023, 12:42 p.m.