seqpack {ff}R Documentation

Packing of seqences

Description

The function seqpack converts vectors of arbitrary indices into a matrix with row items “from”, “to” and “by”. Sequences within the input vector are automatically detected.

Usage

  seqpack(x)
  

Arguments

x a vector containing indices, i.e. integers.

Details

Extracting a subset of an ff object results in R to C calls. In order to avoid calling overhead resulting from a sequential processing of the indices, the indices of the subset are analysed and converted by seqpack. This way, an extraction of arbitrary sequences involves only a single R to C call. This feature is currently only implemented for ff objects.

Value

A matrix with row items “from”, “to” and “by”. The sub-sequences (and single indices) are given in the column in the same order that they appear in the input.

See Also

ff

Examples

  seqpack(c(1:5,4,1,seq(2,20,4)))
  

[Package ff version 1.0-1 Index]