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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 26 16:58:42 CET 2013


Author: jarioksa
Date: 2013-02-26 16:58:41 +0100 (Tue, 26 Feb 2013)
New Revision: 2452

Modified:
   pkg/vegan/R/points.cca.R
   pkg/vegan/R/text.cca.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/plot.cca.Rd
Log:
plot/text.cca gained arg 'axis.bp = TRUE' to suppress drawing axes for biplot arrows

Modified: pkg/vegan/R/points.cca.R
===================================================================
--- pkg/vegan/R/points.cca.R	2013-02-22 09:22:05 UTC (rev 2451)
+++ pkg/vegan/R/points.cca.R	2013-02-26 15:58:41 UTC (rev 2452)
@@ -1,6 +1,6 @@
 `points.cca` <-
     function (x, display = "sites", choices = c(1, 2), scaling = 2,
-              arrow.mul, head.arrow = 0.05, select, const, ...)
+              arrow.mul, head.arrow = 0.05, select, const, axis.bp = TRUE, ...)
 {
     formals(arrows) <- c(formals(arrows), alist(... = ))
     if (length(display) > 1)
@@ -28,10 +28,12 @@
         arrows(0, 0, pts[, 1], pts[, 2], length = head.arrow,
                ...)
         pts <- pts * 1.1
-        axis(3, at = c(-arrow.mul, 0, arrow.mul), labels = rep("",
-                                                  3))
-        axis(4, at = c(-arrow.mul, 0, arrow.mul), labels = c(-1,
-                                                  0, 1))
+        if (axis.bp) {
+            axis(3, at = c(-arrow.mul, 0, arrow.mul),
+                 labels = rep("", 3))
+            axis(4, at = c(-arrow.mul, 0, arrow.mul),
+                 labels = c(-1, 0, 1))
+        }
         return(invisible())
     }
     points(pts, ...)

Modified: pkg/vegan/R/text.cca.R
===================================================================
--- pkg/vegan/R/text.cca.R	2013-02-22 09:22:05 UTC (rev 2451)
+++ pkg/vegan/R/text.cca.R	2013-02-26 15:58:41 UTC (rev 2452)
@@ -1,6 +1,6 @@
 `text.cca` <-
     function (x, display = "sites", labels, choices = c(1, 2), scaling = 2,
-              arrow.mul, head.arrow = 0.05, select, const, ...)
+              arrow.mul, head.arrow = 0.05, select, const, axis.bp = TRUE, ...)
 {
     formals(arrows) <- c(formals(arrows), alist(... = ))
     if (length(display) > 1)
@@ -30,10 +30,12 @@
         arrows(0, 0, pts[, 1], pts[, 2], length = head.arrow,
                ...)
         pts <- pts * 1.1
-        axis(3, at = c(-arrow.mul, 0, arrow.mul), labels = rep("",
-                                                  3))
-        axis(4, at = c(-arrow.mul, 0, arrow.mul), labels = c(-1,
-                                                  0, 1))
+        if (axis.bp) {
+            axis(side = 3, at = c(-arrow.mul, 0, arrow.mul),
+                 labels = rep("", 3))
+            axis(side = 4, at = c(-arrow.mul, 0, arrow.mul),
+                 labels = c(-1, 0, 1))
+        }
     }
     text(pts, labels = rownames(pts), ...)
     invisible()

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2013-02-22 09:22:05 UTC (rev 2451)
+++ pkg/vegan/inst/ChangeLog	2013-02-26 15:58:41 UTC (rev 2452)
@@ -12,6 +12,10 @@
 	user query by Bastien Mérigot (Univ Montpellier II). The working
 	of the new argument is still untested with specaccum() support
 	functions.
+
+	* text.cca, points.cca: gained argument 'axis.bp' (defaults TRUE)
+	to suppress drawing axes for scaled biplot arrows. Only effective
+	if 'bp' scores were requested.
 	
 Version 2.1-26 (opened February 11, 2013)
 

Modified: pkg/vegan/man/plot.cca.Rd
===================================================================
--- pkg/vegan/man/plot.cca.Rd	2013-02-22 09:22:05 UTC (rev 2451)
+++ pkg/vegan/man/plot.cca.Rd	2013-02-26 15:58:41 UTC (rev 2452)
@@ -21,9 +21,9 @@
 \method{plot}{cca}(x, choices = c(1, 2), display = c("sp", "wa", "cn"),
          scaling = 2, type, xlim, ylim, const, ...)
 \method{text}{cca}(x, display = "sites", labels, choices = c(1, 2), scaling = 2,
-    arrow.mul, head.arrow = 0.05, select, const, ...)
+    arrow.mul, head.arrow = 0.05, select, const, axis.bp = TRUE, ...)
 \method{points}{cca}(x, display = "sites", choices = c(1, 2), scaling = 2,
-    arrow.mul, head.arrow = 0.05, select, const, ...)
+    arrow.mul, head.arrow = 0.05, select, const, axis.bp = TRUE, ...)
 \method{scores}{cca}(x, choices=c(1,2), display=c("sp","wa","cn"), scaling=2, ...)
 \method{scores}{rda}(x, choices=c(1,2), display=c("sp","wa","cn"), scaling=2, 
     const, ...)
@@ -74,6 +74,7 @@
     \samp{decision-vegan.pdf} with \code{\link{vegandocs}} for details
     and discussion). If \code{const} is a vector of two items, the first
     is used for species, and the second item for site scores.}
+  \item{axis.bp}{Draw \code{\link{axis}} for biplot arrows.}
   \item{axes}{Number of axes in summaries.}
   \item{digits}{Number of digits in output.}
   \item{n, head, tail}{Number of rows printed from the head and tail of



More information about the Vegan-commits mailing list