[Vegan-commits] r2437 - in pkg/vegan: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 13 18:26:46 CET 2013


Author: jarioksa
Date: 2013-02-13 18:26:46 +0100 (Wed, 13 Feb 2013)
New Revision: 2437

Modified:
   pkg/vegan/R/tabasco.R
   pkg/vegan/R/vegemite.R
   pkg/vegan/inst/ChangeLog
Log:
tabasco & vegemite know cluster::agnes trees, and tabasco can handle picante::phylo trees for species (not tested)

Modified: pkg/vegan/R/tabasco.R
===================================================================
--- pkg/vegan/R/tabasco.R	2013-02-13 17:03:01 UTC (rev 2436)
+++ pkg/vegan/R/tabasco.R	2013-02-13 17:26:46 UTC (rev 2437)
@@ -24,7 +24,9 @@
                 sp.ind <- order(wascores(order(site.ind), x))
             Colv <- as.dendrogram(use)
         }
-        else if (inherits(use, "dendrogram")) {
+        else if (inherits(use, c("dendrogram", "twins"))) {
+            if (!inherits(use, "dendrogram"))
+                use <- as.dendrogram(use)
             if (!is.null(site.ind))
                 stop("'dendrogram' cannot be 'use'd with 'site.ind'")
             site.ind <- seq_len(nrow(x))
@@ -53,7 +55,10 @@
         }
     }
     ## see if sp.ind is a dendrogram or hclust tree
-    if (inherits(sp.ind, c("hclust", "dendrogram"))) {
+    if (inherits(sp.ind, c("hclust", "dendrogram", "twins", "phylo"))) {
+        ## phylo trees are from picante: they only have as.hclust method
+        if (inherits(sp.ind, "phylo"))
+            sp.ind <- as.hclust(sp.ind)
         if (!inherits(sp.ind, "dendrogram"))
             sp.ind <- as.dendrogram(sp.ind)
         Rowv <- sp.ind

Modified: pkg/vegan/R/vegemite.R
===================================================================
--- pkg/vegan/R/vegemite.R	2013-02-13 17:03:01 UTC (rev 2436)
+++ pkg/vegan/R/vegemite.R	2013-02-13 17:26:46 UTC (rev 2437)
@@ -9,7 +9,9 @@
             if (is.null(sp.ind)) 
                 sp.ind <- order(wascores(use, x))
         }
-        else if (inherits(use, "hclust")) {
+        else if (inherits(use, c("hclust", "twins"))) {
+            if (!inherits(use, "hclust"))
+                use <- as.hclust(use)
             if (is.null(site.ind)) 
                 site.ind <- use$order
             if (is.null(sp.ind)) 

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2013-02-13 17:03:01 UTC (rev 2436)
+++ pkg/vegan/inst/ChangeLog	2013-02-13 17:26:46 UTC (rev 2437)
@@ -8,7 +8,9 @@
 	11, 2013.
 
 	* tabasco: a sister function of vegemite() to display a compact
-	community table using heatmap(). 
+	community table using heatmap(). Both vegemite() and tabasco() can
+	handle cluster::agnes() trees, and tabasco() can handle
+	picante::phylo() trees for species.
 
 	* wcmdscale: return a full "wcmdscale" object if any argument is
 	set to non-default value. This also implies that if weights 'w'



More information about the Vegan-commits mailing list