View source: R/event-classes.R
event_factor | R Documentation |
This is a user-facing wrapper around the internal event()
constructor,
specifically for creating categorical event sequences from factors or characters.
event_factor(fac, name, onsets, blockids = 1, durations = 0, subset = NULL)
fac |
A factor or something coercible to a factor. |
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 Column names are sanitized using |
An S3 object of class event
and event_seq
.
event_model
, event_variable
, event_matrix
, event_basis
efac <- event_factor(factor(c("a", "b", "c", "a", "b", "c")), "abc",
onsets = seq(1, 100, length.out = 6))
print(efac)
levels(efac)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.