Hello, I am facing a problem in drawing heat map using R. I have a 70X3 matrix and I want to draw a heat map with 1 coloumn on X axis another on Y axis and want to show the value of 3rd coloumn using heat colours. Could you please help me with this . Thank you . Regards, Sumit [[alternative HTML version deleted]]
Hi r-help-bounces at r-project.org napsal dne 10.06.2008 14:49:55:> Hello, > > I am facing a problem in drawing heat map using R. > > I have a 70X3 matrix and I want to draw a heat map with 1 coloumn on Xaxis> another on Y axis and want to show the value of 3rd coloumn using heat > colours. > Could you please help me with this .You can use function interp from akima package Petr> Thank you . > > Regards, > Sumit > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
Look at the "image" function and the "levelplot" function in the lattice package. -----Original Message----- From: "sumit gupta" <sumit.iitm at gmail.com> To: "r-help at r-project.org" <r-help at r-project.org> Sent: 6/10/08 6:55 AM Subject: [R] Hello Hello, I am facing a problem in drawing heat map using R. I have a 70X3 matrix and I want to draw a heat map with 1 coloumn on X axis another on Y axis and want to show the value of 3rd coloumn using heat colours. Could you please help me with this . Thank you . Regards, Sumit [[alternative HTML version deleted]] ______________________________________________ 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.
"sumit gupta" <sumit.iitm at gmail.com> napsal dne 11.06.2008 07:53:54:> Hello > thanx for the info.. > > I still have tthe doubt regarding the heat map. > I am attching a plot of a 70X3 data matrix.In which 3rd variable hasbeen> shown as colour of different boxes.Could you help me to draw this typeof graph using R Well, as you did not provided some data mat<-cbind(sample(1:5, 70, replace=T), sample(1:5, 70, replace=T), rnorm(70)) dim(mat) [1] 70 3 library(akima) filled.contour(interp(mat[,1], mat[,2], mat[,3], duplicate="mean")) image(interp(mat[,1], mat[,2], mat[,3], duplicate="mean")) is this what you want? Regards Petr> > Regards, > Sumit > > > On 6/10/08, Petr PIKAL <petr.pikal at precheza.cz> wrote: > Hi > > r-help-bounces at r-project.org napsal dne 10.06.2008 14:49:55: > > > Hello, > > > > I am facing a problem in drawing heat map using R. > > > > I have a 70X3 matrix and I want to draw a heat map with 1 coloumn on X > axis > > another on Y axis and want to show the value of 3rd coloumn using heat > > colours. > > Could you please help me with this . > > You can use function interp from akima package > > Petr > > > Thank you . > > > > Regards, > > Sumit > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > 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.> > > > -- > Sumit Kumar Gupta > 4thYear ,Biotechnology > IIT Madras [p??loha rfm.bmp odstran?na u?ivatelem Petr PIKAL/CTCAP]
Hii The contour plot is somewhat similar to what I want. I am attaching the data here. What I want to do is divide all the three variable( Recency, frequency,and monetory ) in 5 intervals based on their values.That will make 25 rectangle(5(recency)X 5(frequency) boxes on heat plot. and then plot a heat map with recency on X axis and frquency on Y axis, and also I want to show the no. of elements in each box( total 25) by heat colours i.e increasing no. of elements with the darker colour box. And one more plot with the same variable on XY as mentioned above but this time box colour depicting the average monetary value of that box. Hope this clears the problem I am facing. Thank you. Regards, Sumit On 6/11/08, Petr PIKAL <petr.pikal at precheza.cz> wrote:> > "sumit gupta" <sumit.iitm at gmail.com> napsal dne 11.06.2008 07:53:54: > > > Hello > > thanx for the info.. > > > > I still have tthe doubt regarding the heat map. > > I am attching a plot of a 70X3 data matrix.In which 3rd variable has > been > > shown as colour of different boxes.Could you help me to draw this type > of graph using R > > Well, as you did not provided some data > > mat<-cbind(sample(1:5, 70, replace=T), sample(1:5, 70, replace=T), > rnorm(70)) > dim(mat) > [1] 70 3 > library(akima) > filled.contour(interp(mat[,1], mat[,2], mat[,3], duplicate="mean")) > image(interp(mat[,1], mat[,2], mat[,3], duplicate="mean")) > > > is this what you want? > > Regards > Petr > > > > > Regards, > > Sumit > > > > > > On 6/10/08, Petr PIKAL <petr.pikal at precheza.cz> wrote: > > Hi > > > > r-help-bounces at r-project.org napsal dne 10.06.2008 14:49:55: > > > > > Hello, > > > > > > I am facing a problem in drawing heat map using R. > > > > > > I have a 70X3 matrix and I want to draw a heat map with 1 coloumn on X > > axis > > > another on Y axis and want to show the value of 3rd coloumn using heat > > > colours. > > > Could you please help me with this . > > > > You can use function interp from akima package > > > > Petr > > > > > Thank you . > > > > > > Regards, > > > Sumit > > > > > > [[alternative HTML version deleted]] > > > > > > ______________________________________________ > > > 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<http://www.r-project.org/posting-guide.html> > > > and provide commented, minimal, self-contained, reproducible code. > > > > > > > > > -- > > Sumit Kumar Gupta > > 4thYear ,Biotechnology > > IIT Madras [p??loha rfm.bmp odstran?na u?ivatelem Petr PIKAL/CTCAP] >-- Sumit Kumar Gupta 4thYear ,Biotechnology IIT Madras -- Sumit Kumar Gupta 4thYear ,Biotechnology IIT Madras -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: rfm.txt URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080611/15d63ef2/attachment.txt>