-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbingo.R
22 lines (18 loc) · 1.07 KB
/
bingo.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
setwd("/Users/ittaieres/Testing/GILAD/g-i-l-a-d ")
require(gplots)
# Change file name at will:
word.list = as.matrix(read.table("bingo_words_y.txt"))
word.list <- gsub("\\n", "\n", word.list, fixed=T)
nw = dim(word.list)[1]
numbers.m <- matrix (1,nrow=5, ncol=5)
# To control the number of cards printed, change the number in the loop.
for (i in 1:11){
# Edit the following two lines if you want to change the central square, or if you simply want to sample 25 terms.
words.ind = sample(1:nw,24)
words = c(word.list[words.ind[1:12],],"FDR",word.list[words.ind[13:24],])
words.m = matrix(words,nrow=5,ncol=5)
#Insert heatmap here
pdf(paste("Bingo_Card_",i,".pdf", sep=""))
heatmap.2 (numbers.m, Rowv=NA, Colv=NA, col =colorRampPalette(c("white","white"))(5), scale="none", dendrogram="none", trace="none", density.info="none", key=F, cellnote=words.m, notecol="black", na.color="grey90",colsep=c(1,2,3,4,5), rowsep=c(1,2,3,4,5), sepcolor="black", sepwidth=c(0.02,0.02), labRow=F, labCol=F, main="G-I-L-A-D", lwid=c(0.2,1), lhei=c(0.2,1))
dev.off()
}