range-OpenTIMS-method: Select a range of frames to extract.

range,OpenTIMS-methodR Documentation

Select a range of frames to extract.

Description

This is similar to using the from:to:by operator in Python.

Usage

## S4 method for signature 'OpenTIMS'
range(x, from, to, by = 1L, na.rm = FALSE)

Arguments

x

OpenTIMS data instance.

from

The first frame to extract.

to

The last+1 frame to extract. Frame with that number will not get extracted, but some below that number might.

by

Extract each by-th frame.

na.rm

Needed to comply with the generic. There should not be any NA frames, since the from and to are checked against the limits of the data.

Value

For the selected frames, a data.frame with columns 'frame', 'scan', 'tof' and 'intensity', one row per peak.

Examples

path.d = system.file("extdata", "test.d", package = "opentimsr")
setup_opensource()
D = OpenTIMS(path.d)
head(range(D, 1, 3))    # frames 1 and 2
head(range(D, 1, 3, 2)) # every second frame, i.e. only frame 1
CloseTIMS(D)

opentimsr documentation built on Nov. 5, 2026, 1:08 a.m.