[Vegan-commits] r552 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 9 16:24:35 CET 2008


Author: jarioksa
Date: 2008-11-09 16:24:35 +0100 (Sun, 09 Nov 2008)
New Revision: 552

Modified:
   pkg/R/plot.cca.R
Log:
plot.cca fix failed when there where NA items, or when some components of cca/rda/capscale where not evaluated

Modified: pkg/R/plot.cca.R
===================================================================
--- pkg/R/plot.cca.R	2008-11-09 07:12:32 UTC (rev 551)
+++ pkg/R/plot.cca.R	2008-11-09 15:24:35 UTC (rev 552)
@@ -8,8 +8,9 @@
         g <- list(default = g)
     ## Take care that there are names
     for (i in 1:length(g)) {
-        rownames(g[[i]]) <- rownames(g[[i]], do.NULL = FALSE,
-                                     prefix = substr(names(g)[i], 1, 3))
+        if (length(dim(g[[i]])) > 1)
+            rownames(g[[i]]) <- rownames(g[[i]], do.NULL = FALSE,
+                                         prefix = substr(names(g)[i], 1, 3))
     }
     if (!is.null(g$centroids)) {
         if (is.null(g$biplot)) 



More information about the Vegan-commits mailing list