[Vegan-commits] r2159 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 10 10:19:40 CEST 2012


Author: jarioksa
Date: 2012-05-10 10:19:40 +0200 (Thu, 10 May 2012)
New Revision: 2159

Modified:
   pkg/vegan/R/ordiplot3d.R
Log:
matrix could drop to a vector in envfit.convert() returned by ordiplot3d

Modified: pkg/vegan/R/ordiplot3d.R
===================================================================
--- pkg/vegan/R/ordiplot3d.R	2012-05-10 07:43:47 UTC (rev 2158)
+++ pkg/vegan/R/ordiplot3d.R	2012-05-10 08:19:40 UTC (rev 2159)
@@ -46,6 +46,9 @@
             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
@@ -54,6 +57,9 @@
             rn <- rownames(object$factors$centroids)
             object$factors$centroids <-
                 sapply(xyz2xy(object$factors$centroids), cbind)
+            if (!is.matrix(object$factors$centroids))
+                object$factors$centroids <-
+                    matrix(object$factors$centroids, ncol = 2)
             rownames(object$factors$centroids) <- rn
         }
         object



More information about the Vegan-commits mailing list