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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 13 14:59:27 CEST 2011


Author: jarioksa
Date: 2011-07-13 14:59:26 +0200 (Wed, 13 Jul 2011)
New Revision: 1679

Modified:
   pkg/vegan/R/ordiellipse.R
   pkg/vegan/R/ordihull.R
   pkg/vegan/R/ordispider.R
   pkg/vegan/inst/ChangeLog
Log:
handle NA scores in ordiellipse, ordihull, ordispider

Modified: pkg/vegan/R/ordiellipse.R
===================================================================
--- pkg/vegan/R/ordiellipse.R	2011-07-05 11:28:23 UTC (rev 1678)
+++ pkg/vegan/R/ordiellipse.R	2011-07-13 12:59:26 UTC (rev 1679)
@@ -30,8 +30,10 @@
     res <- list()
     if (label)
         cntrs <- names <- NULL
+    ## Remove NA scores
+    kk <- complete.cases(pts)
     for (is in inds) {
-        gr <- out[groups == is]
+        gr <- out[groups == is & kk]
         if (length(gr) > 2) {
             X <- pts[gr, ]
             W <- w[gr]

Modified: pkg/vegan/R/ordihull.R
===================================================================
--- pkg/vegan/R/ordihull.R	2011-07-05 11:28:23 UTC (rev 1678)
+++ pkg/vegan/R/ordihull.R	2011-07-13 12:59:26 UTC (rev 1679)
@@ -13,8 +13,10 @@
     out <- seq(along = groups)
     inds <- names(table(groups))
     res <- list()
+    ## Remove NA scores
+    kk <- complete.cases(pts)
     for (is in inds) {
-        gr <- out[groups == is]
+        gr <- out[groups == is & kk]
         if (length(gr) > 1) {
             X <- pts[gr, ]
             hpts <- chull(X)

Modified: pkg/vegan/R/ordispider.R
===================================================================
--- pkg/vegan/R/ordispider.R	2011-07-05 11:28:23 UTC (rev 1678)
+++ pkg/vegan/R/ordispider.R	2011-07-13 12:59:26 UTC (rev 1679)
@@ -29,8 +29,10 @@
     inds <- names(table(groups))
     if (label) 
     cntrs <- names <- NULL
+    ## 'kk' removes NA scores
+    kk <- complete.cases(pts)
     for (is in inds) {
-        gr <- out[groups == is]
+        gr <- out[groups == is & kk]
         if (length(gr) > 1) {
             X <- pts[gr, ]
             W <- w[gr]

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-07-05 11:28:23 UTC (rev 1678)
+++ pkg/vegan/inst/ChangeLog	2011-07-13 12:59:26 UTC (rev 1679)
@@ -4,6 +4,10 @@
 
 Version 1.90-1 (opened July 3, 2011)
 
+	* ordiellipse, ordihull, ordispider: will remove NA scores that
+	can appear with na.action in cca/rda/capscale (and perhaps in
+	other cases).
+
 	* betadiver: argument 'index' was renamed to 'method' for
 	compatibility with dist() objects. Argument 'index' is
 	still recognized with a warning.



More information about the Vegan-commits mailing list