Skip to content

Instantly share code, notes, and snippets.

@sashaphanes
Created May 15, 2013 13:12
Show Gist options
  • Save sashaphanes/5583909 to your computer and use it in GitHub Desktop.
Save sashaphanes/5583909 to your computer and use it in GitHub Desktop.
setwd("C:/Users/Sasha/Google Drive/LNGstuff/Human")
maoa = read.csv("mergedAtransposed.csv")
maob = read.csv("mergedBtransposed.csv")
test.result = mapply(t.test, maoa, maob)
p.values = stack(mapply(function(x, y) t.test(x,y)$p.value, maoa, maob))
matrix.maoa = as.matrix(maoa)
matrix.maob = as.matrix(maob)
fun = Vectorize(function(i,j) t.test(matrix.maoa[,i],matrix.maob[,j])$p.value)
res = outer(1:27,1:27,FUN = "fun")
image(1:27,1:27,res,axes=FALSE,xlab="MAOA",ylab="MAOB")
axis(1, at = 1:27,labels=colnames(maoa))
axis(2, at = 1:27,labels=colnames(maoa))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment