Learn R Programming

mpoly (version 1.1.2)

partitions: Enumerate the partitions of an integer

Description

Determine all unrestricted partitions of an integer. This function is equivalent to the function parts in the partitions package.

Usage

partitions(n)

Value

a matrix whose rows are the n-tuples

Arguments

n

an integer

Author

Robin K. S. Hankin, from package partitions

Examples

Run this code
partitions(5)
str(partitions(5))

Run the code above in your browser using DataLab