Learn R Programming

KarsTS (version 2.4.1)

groupIndices: groupIndices: group indices

Description

This function groups a set of sorted indices. For example: 1,2,3,50,100,101,102,103 would be grouped as follows: 1-3, 50, 100-103.It is used internally.

Usage

groupIndices(rawIndices)

Arguments

rawIndices

The indices

Value

It returns a data frame. Each row corresponds to a group. The columns are: initial index, final index and group length.

Examples

Run this code
# NOT RUN {
X <- sort(sample(1:50,25))
X
groupIndices(X)

# }

Run the code above in your browser using DataLab