fixDesignMatrixColnames: Fix design matrix colnames so that they are legal variable...

View source: R/fixDesignMatrixColnames.R

fixDesignMatrixColnamesR Documentation

Fix design matrix colnames so that they are legal variable names

Description

Fix design matrix colnames so that they are legal variable names

Usage

fixDesignMatrixColnames(
  designMatrix,
  interceptChar = "_",
  removeContrastNames = TRUE
)

Arguments

designMatrix

A design matrix, produced by model.matrix

interceptChar

Character string, the value the interaction symbol (:) should be replaced with

removeContrastNames

Logical, whether the contrast variable name should be removed.

Value

The matrix with fixed colum names.

Examples

myFac1 <- gl(6,2, labels=sprintf("Fac1_%d", 1:6))
myFac2 <- gl(2,6, labels=c("Ctrl", "Dis"))
myVar <- rnorm(12)
myDesign <- model.matrix(~myFac1 * myFac2 + myVar)
head(myDesign)
head(fixDesignMatrixColnames(myDesign))

bedapub/ribiosExpression documentation built on Sept. 2, 2023, 4:37 a.m.