DesignContrast: Contrast a DesignContrast object

View source: R/DesignContrast.R

DesignContrastR Documentation

Contrast a DesignContrast object

Description

Contrast a DesignContrast object

Usage

DesignContrast(
  designMatrix,
  contrastMatrix = NULL,
  groups = NULL,
  dispLevels = NULL,
  contrastAnnotation = NULL
)

Arguments

designMatrix

A design matrix

contrastMatrix

A contrast matrix. If null, no comparison can be done.

groups

A factor vector of the same length as the number of columns of the design matrix. If missing, design2group is used to infer groups.

dispLevels

A character vector of the same length as the number of levels encoded by group, indicating how different groups should be labelled. If missing, levels of group are used.

contrastAnnotation

A data.frame or NULL, annotating contrasts

Value

A DesignContrast object

Examples

myFac <- gl(3,3, labels=c("baseline", "treat1", "treat2"))
myDesign <- model.matrix(~myFac)
colnames(myDesign) <- c("baseline", "treat1", "treat2")
myContrast <- limma::makeContrasts(contrasts=c("treat1", "treat2"), levels=myDesign)
DesignContrast(myDesign, myContrast, groups=myFac)
DesignContrast(myDesign, myContrast, groups=myFac, dispLevels=c("C", "T1", "T2"))

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