better_model_matrix: Creates a much nicer formatted design matrix than the default...

View source: R/stat_utils.R

better_model_matrixR Documentation

Creates a much nicer formatted design matrix than the default model.matrix

Description

I made this function because the way the model.matrix function creates a desing matrix, can cause issues with differential gene expression tools, such as edgeR, DESeq2, and limma. If the intercept column is included, it first removes the parens and parens from the intercept column and then removing the variable name from the colnames and replaces them with factor level vs reference level syntax. If the design is specified without an intercept, variable concatentation is simply removed.

Usage

better_model_matrix(..., data, show_warnings = TRUE)

Arguments

...

formula with outcome as first variable

data

data.frame

show_warnings

logical whether to show wanrings

Value

model.matrix


lefeverde/lefutils documentation built on Sept. 18, 2024, 7:30 a.m.