Skip to contents

This function generates a categorical event sequence object from a given factor. It can be used to create event sequences for categorical predictors in fMRI data analyses.

Usage

event_factor(
  fac,
  name,
  onsets,
  blockids = rep(1, length(fac)),
  durations = rep(0, length(fac))
)

Arguments

fac

A factor representing the categorical event sequence

name

A character string providing a name for the event sequence

onsets

A numeric vector of onsets for each event in the sequence

blockids

A numeric vector of block identifiers for each event in the sequence (default: rep(1, length(fac)))

durations

A numeric vector of durations for each event in the sequence (default: rep(0, length(fac)))

Value

An object representing the categorical event sequence, with class "event_factor" and "event_seq"

See also

Examples

efac <- event_factor(factor(c("a", "b", "c", "a", "b", "c")), "abc", onsets=seq(1, 100, length.out=6))