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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri May 11 10:26:49 CEST 2012


Author: jarioksa
Date: 2012-05-11 10:26:48 +0200 (Fri, 11 May 2012)
New Revision: 2168

Modified:
   pkg/vegan/R/ordiplot3d.R
   pkg/vegan/inst/ChangeLog
Log:
envift.convert() did not honour choices set in ordiplot3d

Modified: pkg/vegan/R/ordiplot3d.R
===================================================================
--- pkg/vegan/R/ordiplot3d.R	2012-05-11 08:08:41 UTC (rev 2167)
+++ pkg/vegan/R/ordiplot3d.R	2012-05-11 08:26:48 UTC (rev 2168)
@@ -53,18 +53,19 @@
     envfit.convert <- function(object) {
         if (!is.null(object$vectors)) {
             rn <- rownames(object$vectors$arrows)
-            object$vectors$arrows <-
-                sapply(xyz2xy(object$vectors$arrows), cbind)
-            if (!is.matrix(object$vectors$arrows))
-                object$vectors$arrows <-
-                    matrix(object$vector$arrows, ncol = 2)
-            object$vectors$arrows <-
-                sweep(object$vector$arrows, 2, pl$origin)
-            rownames(object$vectors$arrows) <- rn
+            arr <- object$vectors$arrows[, choices, drop = FALSE]
+            arr <- sapply(xyz2xy(arr), cbind)
+            if (!is.matrix(arr))
+                arr <- matrix(arr, ncol = 2)
+            arr <- sweep(arr, 2, pl$origin)
+            rownames(arr) <- rn
+            object$vectors$arrows <- arr
         }
         if (!is.null(object$factors)) {
             rn <- rownames(object$factors$centroids)
             object$factors$centroids <-
+                object$factors$centroids[ ,choices, drop = FALSE]
+            object$factors$centroids <-
                 sapply(xyz2xy(object$factors$centroids), cbind)
             if (!is.matrix(object$factors$centroids))
                 object$factors$centroids <-

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2012-05-11 08:08:41 UTC (rev 2167)
+++ pkg/vegan/inst/ChangeLog	2012-05-11 08:26:48 UTC (rev 2168)
@@ -7,6 +7,9 @@
 	* update.nullmodel: explicit assignment is required to update
 	the input object (nm <- update(nm, ...)).
 
+	* ordiplot3d: the returned envfit.convert() function did not
+	recognize 'choices'.
+
 Version 2.1-15 (closed May 11, 2012)
 
 	* rrarefy, drarefy: check the data are integers -- the functions



More information about the Vegan-commits mailing list