event_model.list | R Documentation |
Constructs an event model from a list of hemodynamic response function (HRF)
specifications (x
), along with additional parameters (data, block, sampling frame,
durations, etc.). All elements in x
must be of type hrfspec
.
## S3 method for class 'list'
event_model(
x,
data,
block,
sampling_frame,
drop_empty = TRUE,
durations = 0,
precision = 0.3,
...
)
x |
A list of HRF specifications. |
data |
The dataset (a data.frame) containing event information. |
block |
The block variable; either a formula or a vector of block values. |
sampling_frame |
The time series grid over which to sample the function. |
drop_empty |
Logical indicating whether to drop empty events. Default is TRUE. |
durations |
A numeric vector of event durations. Default is 0 for all events. |
precision |
Numeric value indicating the precision for HRF sampling. Default is 0.3. |
... |
Additional arguments. |
Construct an event model from a list of HRF specifications.
An event model object.
# Example for event_model.list:
# Assume HRF_SPMG1 is a predefined hrfspec object.
df <- data.frame(onset = seq(1, 100, by = 10),
run = rep(1:2, each = 5))
# Create a list of HRF specifications:
hrf_list <- list(HRF_SPMG1)
# Create a sampling frame (assume sampling_frame() is defined)
sframe <- sampling_frame(blocklens = c(50, 50), TR = 2)
# Construct the event model
ev_model <- event_model.list(x = hrf_list, data = df, block = ~ run, sampling_frame = sframe)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.