Hello,<br><br> I have two scripts that are used to generate heatmap and bar graph<br><br><span style="color: rgb(51, 51, 255);"><b>A. Heatmap script:</b> </span><br style="color: rgb(51, 51, 255);"><br><span style="color: rgb(51, 51, 255);">library(RColorBrewer)</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">library(gplots)</span><br style="color: rgb(51, 51, 255);"><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">par(mfrow=c(2,1))</span><br style="color: rgb(51, 51, 255);">
<br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">Totaltax<-read.table("heatmap_data.txt",header=TRUE)</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">Totaltax_log<-log(Totaltax+1)</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">Totaltax_mat<-data.matrix(Totaltax_log)</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">Totaltax_column<-t(Totaltax_mat)</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">cdendro<-as.dendrogram(hclust(dist(Totaltax_column, method="manhattan")),method="complete")</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">heatmap.2(Totaltax_mat, Colv=cdendro, distfun=dist, key=TRUE, keysize=1, trace="none", margins=c(5,13), col=brewer.pal(9,"BuPu"))</span><br>
<br><br clear="all"><b><span style="color: rgb(255, 0, 0);">B. Bar graph script:</span></b><br style="color: rgb(255, 0, 0);"><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">histo <- read.table("histo_data.txt", header=T)</span><span style="color: rgb(255, 0, 0);"></span><br style="color: rgb(255, 0, 0);">
<br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">barplot(histo$Value)</span><br><br><br>Usually, I would run each script separately, and put the two resulting diagrams together using Adobe Illustrator. I was wondering if there is a way to put these two diagrams together in R, instead of going through the manual procedures. I am currently using R version 2.11.1 on Mac OS X 10.6. The actual data used to generate the diagrams are attached in this message. Thank you very much in advance.<br>
<br> Sincerely,<br><br> Young<br>-- <br>Young C. Song<br>Masters Student<br><font size="-1">University of British Columbia Graduate Program in
Bioinformatics<br>Vancouver, BC V6T 1Z4, Canada</font><br><br>