Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plotContrasts

Plot representation of contrast matrix


Description

Plot contrast matrix to clarify interpretation of hypothesis tests with linear contrasts

Usage

plotContrasts(L)

Arguments

L

contrast matrix

Value

ggplot2 object

Examples

# load library
# library(variancePartition)

# load simulated data:
# geneExpr: matrix of gene expression values
# info: information/metadata about each sample
data(varPartData)

# get contrast matrix testing if the coefficient for Batch2 is zero 
form <- ~ Batch + (1|Individual) + (1|Tissue) 
L1 = getContrast( geneExpr, form, info, "Batch3")

# get contrast matrix testing if the coefficient for Batch2 is different from Batch3 
form <- ~ Batch + (1|Individual) + (1|Tissue) 
L2 = getContrast( geneExpr, form, info, c("Batch2", "Batch3"))

# combine contrasts into single matrix
L_combined = cbind(L1, L2)

# plot contrasts
plotContrasts( L_combined )

variancePartition

Quantify and interpret divers of variation in multilevel gene expression experiments

v1.20.0
GPL (>= 2)
Authors
Gabriel E. Hoffman
Initial release
2020-10-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.