conditions | R Documentation |
Return the set of condition labels associated with a model term. Conditions represent
the unique experimental conditions in the design, typically formed from factor levels
and/or basis functions. For example, a term with factor "stimulus" (levels: face, house)
and two basis functions would have conditions: "stimulus[face]:basis1"
, "stimulus[face]:basis2"
,
"stimulus[house]:basis1"
, "stimulus[house]:basis2"
.
conditions(x, ...)
x |
The model term (typically an event_term, event_model, or convolved_term) |
... |
Additional arguments passed to methods. Common arguments include:
|
A character vector of condition labels
cells()
, event_model()
, hrf()
# Create a simple event model with a categorical predictor
event_data <- data.frame(
stimulus = factor(c("face", "house", "face", "house")),
onsets = c(1, 10, 20, 30),
run = c(1, 1, 1, 1)
)
# Create a sampling frame
sframe <- sampling_frame(blocklens = 50, TR = 2)
# Create an event model with canonical HRF
evmodel <- event_model(
onsets ~ hrf(stimulus),
data = event_data,
block = ~run,
sampling_frame = sframe
)
# Get condition labels
conditions(evmodel) # Returns: c("stimulus[face]", "stimulus[house]")
# Create model with multiple basis functions
evmodel2 <- event_model(
onsets ~ hrf(stimulus, basis = "fourier", nbasis = 2),
data = event_data,
block = ~run,
sampling_frame = sframe
)
# Get conditions with basis functions
conditions(evmodel2) # Returns conditions with basis labels
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.