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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 1 20:52:43 CEST 2009


Author: jarioksa
Date: 2009-09-01 20:52:42 +0200 (Tue, 01 Sep 2009)
New Revision: 979

Modified:
   pkg/vegan/R/coef.cca.R
   pkg/vegan/R/coef.rda.R
   pkg/vegan/inst/ChangeLog
Log:
coef works with cca/rda na.action = na.exclude

Modified: pkg/vegan/R/coef.cca.R
===================================================================
--- pkg/vegan/R/coef.cca.R	2009-09-01 18:40:38 UTC (rev 978)
+++ pkg/vegan/R/coef.cca.R	2009-09-01 18:52:42 UTC (rev 979)
@@ -1,9 +1,10 @@
 "coef.cca" <-
 function (object, ...) 
 {
+        k <- !is.na(object$rowsum)
 	Q <- object$CCA$QR
-	u <- object$CCA$u
-	u <- sweep(u, 1, sqrt(object$rowsum), "*")
+	u <- object$CCA$u[k,]
+	u <- sweep(u, 1, sqrt(object$rowsum[k]), "*")
 	qr.coef(Q, u)
 }
 

Modified: pkg/vegan/R/coef.rda.R
===================================================================
--- pkg/vegan/R/coef.rda.R	2009-09-01 18:40:38 UTC (rev 978)
+++ pkg/vegan/R/coef.rda.R	2009-09-01 18:52:42 UTC (rev 979)
@@ -1,7 +1,7 @@
 "coef.rda" <-
 function (object, ...) 
 {
-	Q <- object$CCA$QR
-	qr.coef(Q, object$CCA$u)
+    Q <- object$CCA$QR
+    qr.coef(Q, object$CCA$u[complete.cases(object$CCA$u),])
 }
 

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-09-01 18:40:38 UTC (rev 978)
+++ pkg/vegan/inst/ChangeLog	2009-09-01 18:52:42 UTC (rev 979)
@@ -4,6 +4,8 @@
 
 Version 1.16-27 (opened September 1, 2009)
 
+	* coef.cca and coef.rda work with na.action = na.exclude.
+
 	* as.mlm.cca and as.mlm.rda work with na.action = na.exclude.
 
 	* permutest.cca and all anova.cca(..., by=) cases work with



More information about the Vegan-commits mailing list