makeDesign: Create a design matrix from a character vector.

View source: R/makeDesign.R

makeDesignR Documentation

Create a design matrix from a character vector.

Description

This function wraps around model.matrix to create a design matrix based on the different levels in model.matrix. Note that the order of the column names of the design matrix will be in lexicographic order according to the locale in use. For more, see ?Comparison

Usage

makeDesign(x)

Arguments

x

Character vector to be used to create the design matrix.

Value

A design matrix as the same type as returned using ?model.matrix.

Examples

n_oligo_samples = 38; n_neuron_samples = 120
cell_type = c(rep("oligodendrocyte", n_oligo_samples), rep("neuron", n_neuron_samples))
design_mat = makeDesign(cell_type)

andymckenzie/DGCA documentation built on Sept. 15, 2023, 5:04 a.m.