samples.sampling_frame: Extract samples from a sampling_frame

View source: R/sampling_frame.R

samples.sampling_frameR Documentation

Extract samples from a sampling_frame

Description

This function extracts the relative or global time of each sample/acquisition from a sampling_frame.

Usage

## S3 method for class 'sampling_frame'
samples(x, blockids = NULL, global = FALSE, ...)

Arguments

x

A sampling_frame object.

blockids

A numeric vector of block IDs to extract the samples from. If NULL (default), all block IDs are used.

global

A logical value. If TRUE, the global time (with respect to the first block) of each sample/acquisition is returned. If FALSE (default), the relative time (with respect to the last block) of each sample/acquisition is returned.

...

Additional arguments (currently unused).

Value

A numeric vector of sample times extracted from the specified sampling_frame.

Examples

frame <- sampling_frame(blocklens = c(100, 100, 100), TR = 2, precision = 0.5)
# The relative time (with respect to the last block) in seconds of each sample/acquisition
sam <- samples(frame)
# The global time (with respect to the first block) of each sample/acquisition
gsam <- samples(frame, global = TRUE)


bbuchsbaum/fmrireg documentation built on May 16, 2023, 10:56 a.m.