sample_partitions: Generate Random, Non-Overlapping Partition of Indices

Description Usage Arguments Value

View source: R/sample_partitions.R

Description

Generate Random, Non-Overlapping Partition of Indices

Usage

1
sample_partitions(n, fraction = NULL, size = NULL, warn = TRUE)

Arguments

n

Number of elements to partition.

fraction

A numeric in (0,1] specifying the size of each set relative to n. If NULL, argument size is used.

size

An integer in {1, 2, ..., n} specifying the size of each set. If NULL, argument fraction is used.

warn

If TRUE, a warning is produced if the sets produced are not of equal size.

Value

A list of random non-overlapping (disjoint) sets where each element holds indices in {1, 2, ..., n} and where the union of all sets is {1, 2, ..., n}.


HenrikBengtsson/TopDomStudy documentation built on May 14, 2021, 1:49 p.m.