event_term | R Documentation |
Generates an event_term
object which represents the combination of one
or more event sequences (e.g., a factor crossed with a numeric modulator).
It takes a list of variables (factors, numeric vectors, matrices, basis objects)
along with shared onsets, block IDs, and durations.
It uses the EV
factory internally to create standardized event
objects for each variable.
event_term(evlist, onsets, blockids, durations = 0, subset = NULL)
evlist |
A named list of variables (factors, numeric, matrices, ParametricBasis objects). The names are used as variable identifiers within the term. |
onsets |
Numeric vector of onset times (in seconds). |
blockids |
Numeric vector of block numbers (non-decreasing integers). |
durations |
Numeric vector of event durations (seconds, default is 0).
Can be scalar (recycled) or vector matching length of |
subset |
Optional logical vector indicating which events to retain (applied before processing). |
A list object with class c("event_term", "event_seq")
. Contains:
varname |
Concatenated variable names from |
events |
A named list of the processed |
subset |
The |
event_table |
A tibble representing the combinations of descriptive levels/names
for each event in the term, constructed using |
onsets |
Numeric vector of onsets (after processing/subsetting). |
blockids |
Numeric vector of block IDs (after processing/subsetting). |
durations |
Numeric vector of durations (after processing/subsetting). |
x1 <- factor(rep(letters[1:3], 10))
x2 <- factor(rep(1:3, each = 10))
onsets <- seq(1, 100, length.out = 30)
blockids <- rep(1:3, each = 10)
eterm <- event_term(list(Condition = x1, Group = x2),
onsets = onsets,
blockids = blockids)
print(eterm)
head(event_table(eterm))
levels(eterm)
head(design_matrix(eterm))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.