enumerate.partitions: Enumerate Partitions of a Set

View source: R/enumerate.partitions.R

enumerate.partitionsR Documentation

Enumerate Partitions of a Set

Description

This function produces a matrix whose rows provide all possible partitions of the set {1, 2, ..., n}. These partitions are provided as cluster labels, where two items are in the same subset (i.e., cluster) if their labels are equal.

Usage

enumerate.partitions(nItems)

Arguments

nItems

The size of the set {1, 2, ..., n}, i.e., n.

Value

A matrix of integers, where each row is a partition encoded as a vector of cluster labels.

Examples

enumerate.partitions(5)


salso documentation built on April 11, 2025, 5:56 p.m.