Hi guys of the R-Help-Team!<br /><br />First of all - you do a great job!<br />I've found a lot of your mails in the internet. So I thought it would be a good idea to ask you a question about R.<br /><br />R is new to me, so sorry, if the question is too simple :)<br /><br />I have a matrix.<br />I can make a 2D Heatmap of this matrix.<br /><br />My question:<br />Can I also make a 3D Heatmap of this matrix - so the third parameter should the value in the matrix.<br /><br />My first thought was :<br />> mat <- read.table(file = "AvgMatrix.mat")<br />> x <-as.matrix(mat)<br />> hv <- heatmap.2 (x, col=topo.colors, Colv = NA, Rowv = NA, main="AvgMatrix", xlab="Columns", ylab="Rows", key=TRUE, trace = "none")<br />But that is just a 2D heatmap.<br /><br />Thanks for your help<br /><br />Ariane<br /><br />
On 23/04/2010 8:51 AM, Ariane C. B?hm wrote:> Hi guys of the R-Help-Team!<br /><br />First of all - you do a great job!<br > />I've found a lot of your mails in the internet. So I thought it would be a > good idea to ask you a question about R.<br /><br />R is new to me, so sorry, > if the question is too simple :)<br /><br />I have a matrix.<br />I can make a > 2D Heatmap of this matrix.<br /><br />My question:<br />Can I also make a 3D > Heatmap of this matrix - so the third parameter should the value in the > matrix.<br /><br />My first thought was :<br />> mat <- read.table(file > = "AvgMatrix.mat")<br />> x <-as.matrix(mat)<br />> hv > <- heatmap.2 (x, col=topo.colors, Colv = NA, Rowv = NA, > main="AvgMatrix", xlab="Columns", ylab="Rows", > key=TRUE, trace = "none")<br />But that is just a 2D heatmap.<br > /><br />Thanks for your help<br /><br />Ariane<br /><br /> >If you can, please turn off the HTML formatting in your email: it makes it quite hard to read. I don't really know what you mean by a 3D heatmap: can you point to any examples of such figures online? You might be thinking of something like persp gives; try example(persp) (or example(persp3d) in the rgl package). Duncan Murdoch> ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
On 04/23/2010 10:51 PM, Ariane C. B?hm wrote:> Hi guys of the R-Help-Team!<br /><br />First of all - you do a great job!<br > />I've found a lot of your mails in the internet. So I thought it would be a > good idea to ask you a question about R.<br /><br />R is new to me, so sorry, > if the question is too simple :)<br /><br />I have a matrix.<br />I can make a > 2D Heatmap of this matrix.<br /><br />My question:<br />Can I also make a 3D > Heatmap of this matrix - so the third parameter should the value in the > matrix.<br /><br />My first thought was :<br />> mat<- read.table(file > ="AvgMatrix.mat")<br />> x<-as.matrix(mat)<br />> hv > <- heatmap.2 (x, col=topo.colors, Colv = NA, Rowv = NA, > main="AvgMatrix", xlab="Columns", ylab="Rows", > key=TRUE, trace ="none")<br />But that is just a 2D heatmap.<br > /><br />Thanks for your help<br /><br />Ariane<br /><br /> >Hi Ariane, The color2D.matplot function can almost do this, as there is an option to display the numeric values within the cells. Now with the small kludge of adding an extra argument: x3=NULL and changing the following lines: if(show.values) text(sort(rep((1:xdim[2])-0.5,xdim[1])), rep(seq(xdim[1]-0.5,0,by=-1),xdim[2]), round(x,show.values),col=vcol,cex=vcex) } to this: if(show.values) if(is.null(x3)) xval<-x else xval<-x3 text(sort(rep((1:xdim[2])-0.5,xdim[1])), rep(seq(xdim[1]-0.5,0,by=-1),xdim[2]), round(xval,show.values),col=vcol,cex=vcex) } You may have a solution to your plotting problem. Of course this will do nothing at all for your problem of sending HTML formatted messages. Jim