groupIndices {KarsTS}R Documentation

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.

Author(s)

Marina Saez Andreu

Examples


X <- sort(sample(1:50,25))
X
groupIndices(X)


[Package KarsTS version 2.4.1 Index]