# load library
# library(variancePartition)
# load simulated data:
data(varPartData)
# Create data.frame with expression and Tissue information for each sample
GE = data.frame( Expression = geneExpr[1,], Tissue = info$Tissue)
# Plot expression stratified by Tissue
plotStratifyBy( GE, "Tissue", "Expression")
# Omit legend and color boxes grey
plotStratifyBy( GE, "Tissue", "Expression", colorBy = NULL)
# Specify colors
col = c( B="green", A="red", C="yellow")
plotStratifyBy( GE, "Tissue", "Expression", colorBy=col, sort=FALSE)
Run the code above in your browser using DataLab