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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Oct 15 20:30:29 CEST 2009


Author: jarioksa
Date: 2009-10-15 20:30:25 +0200 (Thu, 15 Oct 2009)
New Revision: 1049

Modified:
   pkg/vegan/R/ordisurf.R
   pkg/vegan/inst/ChangeLog
Log:
ordisurf handles NA

Modified: pkg/vegan/R/ordisurf.R
===================================================================
--- pkg/vegan/R/ordisurf.R	2009-10-15 13:15:34 UTC (rev 1048)
+++ pkg/vegan/R/ordisurf.R	2009-10-15 18:30:25 UTC (rev 1049)
@@ -11,6 +11,10 @@
         w <- NULL
     require(mgcv)  || stop("Requires package 'mgcv'")
     X <- scores(x, choices = choices, display = display, ...)
+    kk <- complete.cases(X) & !is.na(y)
+    X <- X[kk, , drop = FALSE]
+    y <- y[kk]
+    w <- w[kk]
     x1 <- X[, 1]
     x2 <- X[, 2]
     if (knots <= 0)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-10-15 13:15:34 UTC (rev 1048)
+++ pkg/vegan/inst/ChangeLog	2009-10-15 18:30:25 UTC (rev 1049)
@@ -4,6 +4,9 @@
 
 Version 1.16-31 (opened October 3, 2009)
 
+	* ordisurf: removes observation with NA in scores (as result of
+	na.action) or in predicted variable.
+
 	* specaccum: "accumulations" in one-site collections are handled
 	with a message() instead of stop()ping with error. Per request of
 	Roeland Kindt.



More information about the Vegan-commits mailing list