<p>Dear list,</p>

<p>I'm trying to cluster data  and then plotting a heatmap using heatmap.2 from ggplot, the script works perfectly with matrices up to 30000 rows, the problems is that I'm using matrices up to 500000 rows (data_sel), and when I try to cluster I get this error:</p>

<pre><code>heatmap.2(as.matrix(data_sel),col=greenred(10), trace="none",cexRow=0.3, cexCol=0.3,  ColSideColors=fenot.colour, margins=c(20,1), labCol="", labRow="",distfun=function(x) dist(x,method="manhattan"))
Error in vector("double", length) : vector size specified is too large
</code></pre>

<p>Is there any approximation using R to plot heatmpas with his big data?</p>

<p>Thanks in advance</p>

<p>With really large data, even a big-ass server may not be enough. The best advice I can offer is to try reducing the size of your data set. Doing this will require intelligently thinking about what it is you're trying to represent.  (related: are you really going to be able to pick out 500k individual points on a little graph the size of your computer screen?)</p>
<p>If, for example, you're plotting expression data from an exon array, maybe you could merge the data and plot per-gene instead of per-exon.  If you're looking for patterns of differential expression, maybe you could plot just the top 1000 most differentially expressed. (and so on)</p>