Skip to contents

This function computes the global onsets (with respect to the first block) for a given sampling_frame.

Usage

# S3 method for sampling_frame
global_onsets(x, onsets, blockids, ...)

Arguments

x

A sampling_frame object.

onsets

A numeric vector of onsets within the specified blocks.

blockids

A numeric vector of block IDs corresponding to the onsets.

...

Additional arguments (currently unused).

Value

A numeric vector of global onsets computed from the specified sampling_frame.

Examples

frame <- sampling_frame(blocklens = c(100, 100, 100), TR = 2, precision = 0.5)
onsets <- c(10, 20, 30)
blockids <- c(1, 2, 3)
global_onsets(frame, onsets, blockids)
#> [1]  10 220 430