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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Oct 3 11:44:07 CEST 2009


Author: jarioksa
Date: 2009-10-03 11:44:06 +0200 (Sat, 03 Oct 2009)
New Revision: 1029

Modified:
   pkg/vegan/R/plot.cca.R
   pkg/vegan/inst/ChangeLog
Log:
plot.cca uses linestack() if only one axis was chosen

Modified: pkg/vegan/R/plot.cca.R
===================================================================
--- pkg/vegan/R/plot.cca.R	2009-10-03 08:55:12 UTC (rev 1028)
+++ pkg/vegan/R/plot.cca.R	2009-10-03 09:44:06 UTC (rev 1029)
@@ -31,6 +31,26 @@
         else type <- "text"
     }
     else type <- match.arg(type, TYPES)
+    ## use linestack (and exit) if only one axis was chosen, and
+    ## display includes row or column scores
+    if (length(choices) == 1) {
+        ## Only one set of scores: plot them
+        if (length(g) == 1)
+            pl <- linestack(g[[1]], ...)
+        ## The order of scores is species, sites, constraints, biplot,
+        ## centroids: plot two first in this order, but species scores
+        ## on the left
+        else {
+            hasSpec <- names(g)[1] == "species"
+            ylim <- range(c(g[[1]], g[[2]]), na.rm = TRUE)
+            pl <- linestack(g[[1]], ylim = ylim,
+                            side = ifelse(hasSpec, "left", "right"), ...)
+            linestack(g[[2]], ylim = ylim,
+                      side = ifelse(hasSpec, "right","left"),
+                      add = TRUE, ...)
+            }
+        return(invisible(pl))
+    }
     if (missing(xlim))
         xlim <- range(g$spe[, 1], g$sit[, 1], g$con[, 1], g$default[,1],
                       na.rm = TRUE)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-10-03 08:55:12 UTC (rev 1028)
+++ pkg/vegan/inst/ChangeLog	2009-10-03 09:44:06 UTC (rev 1029)
@@ -4,8 +4,8 @@
 
 Version 1.16-31 (opened October 3, 2009)
 
-	* plot.decorana: uses linestack() if only one dimension was
-	chosen. 
+	* plot.decorana & plot.cca: use linestack() if only one dimension
+	was chosen.
 
 	* scores.lda: new function to extract row scores and predictor
 	coefficients from "lda" objects (MASS package). Magically,



More information about the Vegan-commits mailing list