Skip to content

Instantly share code, notes, and snippets.

@avalind
Created May 8, 2015 20:53
Show Gist options
  • Save avalind/ca947625d660c3ddd36b to your computer and use it in GitHub Desktop.
Save avalind/ca947625d660c3ddd36b to your computer and use it in GitHub Desktop.
For box plots of expression levels when there are a very small number of samples for one factor.
generate.dataset <- function() {
return(data.frame(
ccsk=runif(20, 2.5, 5.0),
wt=runif(20, 1.5, 4.5),
ak=runif(20, 1.0, 1.25),
fk=runif(20, 0.5, 1.0)))
}
build.plot <- function() {
synthetic <- generate.dataset()
fk = synthetic[,"fk"]
synthetic[,"fk"]=NA
boxplot(synthetic, xlab="Sample Type", ylab="Gene Expression Level", cex=0)
synthetic[,"fk"]=fk
synthetic[,c("ccsk","wt","ak")]=NA
stripchart(synthetic, vertical=T, method="jitter", pch=16, add=T, col=1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment