Learn R Programming

fritools (version 4.6.0)

index_groups: Determine Indices and Sizes of Subsets

Description

Create starting and stopping indices for subsets defined by subset_sizes.

Usage

index_groups(n, k)

Value

A matrix with starting index, size, and stopping index for each subset.

Arguments

n

The size of the set.

k

The number of subsets.

See Also

Other subsetting functions: subset_sizes()

Examples

Run this code
index_groups(n = 100, k = 6)
index_groups(n = 2, k = 6)

Run the code above in your browser using DataLab