Extract or construct a design matrix
Source:R/baseline_model.R
, R/design_generics.R
, R/event_model.R
, and 1 more
design_matrix.Rd
Extract or construct a design matrix
Usage
# S3 method for class 'baseline_model'
design_matrix(x, blockid = NULL, allrows = FALSE, ...)
# S3 method for class 'baseline_term'
design_matrix(x, blockid = NULL, allrows = FALSE, ...)
design_matrix(x, ...)
# S3 method for class 'event_model'
design_matrix(x, blockid = NULL, ...)
# S3 method for class 'event_term'
design_matrix(x, drop.empty = TRUE, ...)
Examples
sframe <- fmrihrf::sampling_frame(blocklens = 6, TR = 1)
bmod <- baseline_model(sframe = sframe)
head(design_matrix(bmod))
#> # A tibble: 6 × 1
#> base_constant1_block_1
#> <dbl>
#> 1 1
#> 2 1
#> 3 1
#> 4 1
#> 5 1
#> 6 1