const.mod.Rd
Using a list of covarietes, constructs a model matrix to be used in a model
const.mod(covs)
covs | a list of covarietes |
---|
a dataframe that can be used as a design matrix in a model
mycovs <- list(batch = sample(c(0, 1), 6, replace = TRUE), array = as.factor(sample(c('a', 'b', 'c'), 6, replace = TRUE)), day = sample(c(0, 1, 3), 6, replace = TRUE)) des_mat <- const.mod(mycovs) print(mycovs)#> $batch #> [1] 0 1 1 0 1 0 #> #> $array #> [1] a b a a a b #> Levels: a b #> #> $day #> [1] 0 0 3 0 0 0 #>print(des_mat)#> batch array.a array.b day #> 1 0 1 0 0 #> 2 1 0 1 0 #> 3 1 1 0 3 #> 4 0 1 0 0 #> 5 1 1 0 0 #> 6 0 0 1 0