event_variable: Create a continuous event sequence from a numeric vector.

View source: R/event-classes.R

event_variableR Documentation

Create a continuous event sequence from a numeric vector.

Description

This is a user-facing wrapper around the internal event() constructor, specifically for creating continuous event sequences from numeric vectors.

Usage

event_variable(vec, name, onsets, blockids = 1, durations = 0, subset = NULL)

Arguments

vec

Numeric vector representing continuous event values.

name

Name of the event variable.

onsets

Numeric vector of event onsets (seconds).

blockids

Numeric vector of block IDs.

durations

Numeric vector of event durations (seconds), or a scalar.

subset

Optional logical vector indicating which events to keep. If provided, the vector must match onsets in length and contain no NA values.

Value

An S3 object of class event and event_seq.

See Also

event_factor

Examples

evar <- event_variable(c(1, 2, 3, 4, 5, 6), "example_var", onsets = seq(1, 100, length.out = 6))
print(evar)
is_continuous(evar)


bbuchsbaum/fmrireg documentation built on June 10, 2025, 8:18 p.m.