better_model_matrix | R Documentation |

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.

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

`...` |
formula with outcome as first variable |

`data` |
data.frame |

`show_warnings` |
logical whether to show wanrings |

model.matrix

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.