Is ggplot2 better than heatmap.2 in R?
2
2
Entering edit mode
9.7 years ago
NHEJ ▴ 360

I have read that "There is no specific heatmap plotting function in ggplot2" on http://learnr.wordpress.com/2010/01/26/ggplot2-quick-heatmap-plotting/

I usually use heatmap.2 in my work after loading in the required gplots package, but I am wondering if ggplots2 is more powerful to use (or the same, or worse than heatmap.2)...

Also, a heatmap.3 option came out not too long ago, but from first inspection I couldn't find anything that heatmap.3 could do that heatmap.2 couldn't. I am probably wrong though. Any input on this issue is appreciated.

heatmap R ggplot2 • 6.9k views
ADD COMMENT
1
Entering edit mode
9.7 years ago

The only big benefit to using ggplot2 is if you already have your data formatted for it (e.g., you're using ggplot2 elsewhere in a given workflow). Otherwise, it's often simpler to just use heatmap.2 on a matrix. I suppose you can prettify a ggplot2 heatmap a bit more, but whether that constitutes "better" or not will be really situation dependent.

ADD COMMENT
0
Entering edit mode

So the only advantage to ggplot2 over heatmap.2 in terms of making a nice looking heatmap is if you're already using ggplot2 somewhere else in your R script? This would make sense from a code reuse statement and keeping things as simple as possible.

ADD REPLY
1
Entering edit mode
7.0 years ago

I'm interested in integrating ggplot2 with d3.js and gridSVG, so as to make interactive web-based figures without relying on a third-party, which I can easily export to publication-quality PDFs. I could see that as a major long-term benefit over heatmap.2.

ADD COMMENT
0
Entering edit mode

You mean something like this? https://blog.rstudio.org/2015/06/24/d3heatmap/

ADD REPLY
0
Entering edit mode

Something like that, but not limited to an R session.

ADD REPLY

Login before adding your answer.

Traffic: 2842 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6