Build Regressors for SPM12 first level model

spm12_regressor(name, value, n_time_points)

spm12_regressor_list(reg, n_time_points)

Arguments

name

Name of the regressor

value

Value of the regressor, must be the same length as n_time_points

n_time_points

Number of time points for the analysis

reg

List of regressors

Value

A list of objects, each with a name and value

Examples

res = spm12_regressor(name = "condition1", value = c(
rep(1, 10), rep(0, 10)), n_time_points = 20)
print(res)
#> $name
#> [1] "'condition1'"
#> 
#> $value
#> [1] "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];"
#> 
L = list(
cond1 = list(value = c(rep(1, 10), rep(0, 10)), n_time_points = 20),
cond2 = list(value = c(rep(0, 10), rep(1, 10)), n_time_points = 20)
)
res = spm12_regressor_list(L, n_time_points = 20)
print(res)
#> $`(1)`
#> $`(1)`$name
#> [1] "'cond1'"
#> 
#> $`(1)`$value
#> [1] "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];"
#> 
#> 
#> $`(2)`
#> $`(2)`$name
#> [1] "'cond2'"
#> 
#> $`(2)`$value
#> [1] "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];"
#> 
#>