[R-gregmisc-users] SF.net SVN: r-gregmisc:[1817] trunk/gplots/R/heatmap.2.R
Brought to you by:
warnes
|
From: <wa...@us...> - 2014-06-05 17:21:17
|
Revision: 1817
http://sourceforge.net/p/r-gregmisc/code/1817
Author: warnes
Date: 2014-06-05 17:21:11 +0000 (Thu, 05 Jun 2014)
Log Message:
-----------
Check size of Rowv and Colv dendogram objects to ensure they matches data.
Modified Paths:
--------------
trunk/gplots/R/heatmap.2.R
Modified: trunk/gplots/R/heatmap.2.R
===================================================================
--- trunk/gplots/R/heatmap.2.R 2014-05-28 00:24:23 UTC (rev 1816)
+++ trunk/gplots/R/heatmap.2.R 2014-06-05 17:21:11 UTC (rev 1817)
@@ -183,6 +183,8 @@
{
ddr <- Rowv ## use Rowv 'as-is', when it is dendrogram
rowInd <- order.dendrogram(ddr)
+ if(length(rowInd)>nr || any(rowInd<1 | rowInd > nr ))
+ stop("Rowv dendrogram doesn't match size of x")
}
else if (is.integer(Rowv))
{ ## Compute dendrogram and do reordering based on given vector
@@ -214,6 +216,8 @@
{
ddc <- Colv ## use Colv 'as-is', when it is dendrogram
colInd <- order.dendrogram(ddc)
+ if(length(ColInd)>nr || any(colInd<1 | colInd > nc ))
+ stop("Colv dendrogram doesn't match size of x")
}
else if(identical(Colv, "Rowv")) {
if(nr != nc)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|