[Vegan-commits] r2969 - in pkg/vegan: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Oct 7 10:22:03 CEST 2015


Author: jarioksa
Date: 2015-10-07 10:22:02 +0200 (Wed, 07 Oct 2015)
New Revision: 2969

Modified:
   pkg/vegan/DESCRIPTION
   pkg/vegan/R/lines.procrustes.R
   pkg/vegan/R/ordiArgAbsorber.R
   pkg/vegan/R/points.procrustes.R
   pkg/vegan/man/procrustes.Rd
   pkg/vegan/man/vegan-internal.Rd
Log:
Merge branch 'cran-2.3' into r-forge-svn-local

Modified: pkg/vegan/DESCRIPTION
===================================================================
--- pkg/vegan/DESCRIPTION	2015-09-24 08:40:35 UTC (rev 2968)
+++ pkg/vegan/DESCRIPTION	2015-10-07 08:22:02 UTC (rev 2969)
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 2.3-1
-Date: 2015-09-24
+Version: 2.3-2
+Date: 2015-09-25
 Author: Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre, 
    Peter R. Minchin, R. B. O'Hara, Gavin L. Simpson, Peter Solymos, 
    M. Henry H. Stevens, Helene Wagner  

Modified: pkg/vegan/R/lines.procrustes.R
===================================================================
--- pkg/vegan/R/lines.procrustes.R	2015-09-24 08:40:35 UTC (rev 2968)
+++ pkg/vegan/R/lines.procrustes.R	2015-10-07 08:22:02 UTC (rev 2969)
@@ -1,12 +1,17 @@
-"lines.procrustes" <-
-    function(x, type=c("segments", "arrows"),  choices=c(1,2), ...)
+`lines.procrustes` <-
+    function(x, type=c("segments", "arrows"),  choices=c(1,2),
+             truemean = FALSE, ...)
 {
     type <- match.arg(type)
     X <- x$X[,choices, drop=FALSE]
     Y <- x$Yrot[, choices, drop=FALSE]
+    if (truemean) {
+        X <- sweep(X, 2, x$xmean[choices], "+")
+        Y <- sweep(Y, 2, x$xmean[choices], "+")
+    }
     if (type == "segments")
-        segments(X[,1], X[,2], Y[,1], Y[,2], ...)
+        ordiArgAbsorber(X[,1], X[,2], Y[,1], Y[,2], FUN = segments, ...)
     else
-        arrows(X[,1], X[,2], Y[,1], Y[,2], ...)
+        ordiArgAbsorber(X[,1], X[,2], Y[,1], Y[,2], FUN = arrows, ...)
     invisible()
 }

Modified: pkg/vegan/R/ordiArgAbsorber.R
===================================================================
--- pkg/vegan/R/ordiArgAbsorber.R	2015-09-24 08:40:35 UTC (rev 2968)
+++ pkg/vegan/R/ordiArgAbsorber.R	2015-10-07 08:22:02 UTC (rev 2969)
@@ -1,3 +1,3 @@
 `ordiArgAbsorber` <- function(..., shrink, origin, scaling, triangular,
-                              display, choices, const, FUN)
+                              display, choices, const, truemean, FUN)
     match.fun(FUN)(...)

Modified: pkg/vegan/R/points.procrustes.R
===================================================================
--- pkg/vegan/R/points.procrustes.R	2015-09-24 08:40:35 UTC (rev 2968)
+++ pkg/vegan/R/points.procrustes.R	2015-10-07 08:22:02 UTC (rev 2969)
@@ -1,19 +1,27 @@
 `points.procrustes` <-
-    function(x, display = c("target","rotated"), ...)
+    function(x, display = c("target","rotated"), choices = c(1,2),
+             truemean = FALSE, ...)
 {
     display <- match.arg(display)
-    x <- if (display == "target") x$X else x$Yrot
-    points(x, ...)
+    X <- if (display == "target") x$X else x$Yrot
+    X <- X[, choices, drop = FALSE]
+    if (truemean)
+        X <- sweep(X, 2, x$xmean[choices], "+")
+    ordiArgAbsorber(X, FUN = points, ...)
     invisible()
 }
 
 `text.procrustes` <-
-    function(x, display = c("target","rotated"), labels, ...)
+    function(x, display = c("target","rotated"), choices = c(1,2),
+             labels, truemean = FALSE, ...)
 {
     display <- match.arg(display)
-    x <- if (display == "target") x$X else x$Yrot
+    X <- if (display == "target") x$X else x$Yrot
+    X <- X[, choices, drop = FALSE]
+    if (truemean)
+        X <- sweep(X, 2, x$xmean[choices], "+")
     if (missing(labels))
-        labels <- rownames(x)
-    text(x, labels = labels, ...)
+        labels <- rownames(X)
+    ordiArgAbsorber(X, labels = labels, FUN = text, ...)
     invisible()
 }

Modified: pkg/vegan/man/procrustes.Rd
===================================================================
--- pkg/vegan/man/procrustes.Rd	2015-09-24 08:40:35 UTC (rev 2968)
+++ pkg/vegan/man/procrustes.Rd	2015-10-07 08:22:02 UTC (rev 2969)
@@ -22,9 +22,12 @@
 \method{plot}{procrustes}(x, kind=1, choices=c(1,2), to.target = TRUE, 
     type = "p", xlab, ylab, main, ar.col = "blue", len=0.05, 
     cex = 0.7, ...)
-\method{points}{procrustes}(x, display = c("target", "rotated"), ...)
-\method{text}{procrustes}(x, display = c("target", "rotated"), labels, ...)
-\method{lines}{procrustes}(x, type = c("segments", "arrows"), choices = c(1, 2), ...)  
+\method{points}{procrustes}(x, display = c("target", "rotated"),
+    choices = c(1,2), truemean = FALSE, ...)
+\method{text}{procrustes}(x, display = c("target", "rotated"),
+    choices = c(1,2), labels, truemean = FALSE, ...)
+\method{lines}{procrustes}(x, type = c("segments", "arrows"),
+    choices = c(1, 2), truemean = FALSE, ...)
 \method{residuals}{procrustes}(object, ...)
 \method{fitted}{procrustes}(object, truemean = TRUE, ...)
 \method{predict}{procrustes}(object, newdata, truemean = TRUE, ...)
@@ -61,7 +64,8 @@
     target and rotated configuration.}
   \item{truemean}{Use the original range of target matrix instead of
     centring the fitted values. Function \code{plot.procrustes} needs
-    \code{truemean = FALSE}.}
+    \code{truemean = FALSE}, and adding graphical items to the plots
+    from the original results may need \code{truemean = TRUE}.}
   \item{newdata}{Matrix of coordinates to be rotated and translated to
      the target.}
   \item{permutations}{a list of control values for the permutations

Modified: pkg/vegan/man/vegan-internal.Rd
===================================================================
--- pkg/vegan/man/vegan-internal.Rd	2015-09-24 08:40:35 UTC (rev 2968)
+++ pkg/vegan/man/vegan-internal.Rd	2015-10-07 08:22:02 UTC (rev 2969)
@@ -27,7 +27,7 @@
 ordiNAexclude(x, excluded)
 ordiNApredict(omit, x)
 ordiArgAbsorber(..., shrink, origin, scaling, triangular,
-                display, choices, const, FUN)
+                display, choices, const, truemean, FUN)
 centroids.cca(x, mf, wt)
 getPermuteMatrix(perm, N, strata = NULL)
 howHead(x, ...)



More information about the Vegan-commits mailing list