amplitudes: Get event amplitudes from an object

View source: R/all_generic.R

amplitudesR Documentation

Get event amplitudes from an object

Description

Extract the amplitude or intensity values associated with each event. Amplitudes represent the strength or magnitude of events and can be used to:

  • Model parametric modulation of neural responses

  • Weight events by their intensity or importance

  • Create amplitude-modulated regressors

Usage

amplitudes(x)

## S3 method for class 'regressor'
amplitudes(x)

Arguments

x

The object containing event information (typically an event_term or event_model)

Value

A numeric vector of amplitude values, where:

  • Each value represents the intensity of an event

  • Default value of 1 indicates unmodulated events

  • Order matches the corresponding event sequence

See Also

event_term(), onsets()

Examples

# Create event data with varying amplitudes
event_data <- data.frame(
  condition = factor(c("stim", "stim", "stim", "stim")),
  onsets = c(1, 10, 20, 30),
  intensity = c(0.5, 1.0, 1.5, 2.0),  # Parametrically varying intensity
  run = c(1, 1, 1, 1)
)

# Create event term with amplitudes
eterm <- event_term(
  list(condition = event_data$condition),
  onsets = event_data$onsets,
  amplitudes = event_data$intensity,
  blockids = event_data$run
)

# Get amplitudes from term
amp <- amplitudes(eterm)  # Returns: c(0.5, 1.0, 1.5, 2.0)

bbuchsbaum/fmrireg documentation built on March 1, 2025, 11:20 a.m.