is_continuous | R Documentation |
Determines if a variable represents continuous (numeric) rather than categorical data. For event terms, continuous variables are those that have numeric values (like amplitudes or modulators) rather than discrete factor levels. For example, reaction times would be continuous, while trial types would be categorical.
is_continuous(x)
x |
The object to check (typically an event_term, event_seq, or event_matrix) |
Logical; TRUE if the variable is continuous (numeric), FALSE if categorical
is_categorical()
, event_term()
Other variable_type:
is_categorical()
# Create event terms with different types
# Categorical event (factor)
event_data <- data.frame(
condition = factor(c("A", "B", "A", "B")),
onsets = c(1, 10, 20, 30),
run = c(1, 1, 1, 1)
)
cat_term <- event_term(
list(condition = event_data$condition),
onsets = event_data$onsets,
blockids = event_data$run
)
is_continuous(cat_term) # Returns: FALSE
# Continuous event (numeric)
event_data$rt <- c(0.8, 1.2, 0.9, 1.1) # reaction times
cont_term <- event_term(
list(rt = event_data$rt),
onsets = event_data$onsets,
blockids = event_data$run
)
is_continuous(cont_term) # Returns: TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.