[Vegan-commits] r403 - in pkg: R inst
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jun 9 06:20:30 CEST 2008
Author: jarioksa
Date: 2008-06-09 06:20:30 +0200 (Mon, 09 Jun 2008)
New Revision: 403
Modified:
pkg/R/predict.cca.R
pkg/R/predict.rda.R
pkg/inst/ChangeLog
Log:
predict.cca/rda rank fixes for type='lc' and with newdata
Modified: pkg/R/predict.cca.R
===================================================================
--- pkg/R/predict.cca.R 2008-06-08 16:06:53 UTC (rev 402)
+++ pkg/R/predict.cca.R 2008-06-09 04:20:30 UTC (rev 403)
@@ -39,7 +39,8 @@
}
E <- sweep(E, 2, c(object$pCCA$envcentre, object$CCA$envcentre),
"-")
- p1 <- object[[model]]$QR$pivot[1:object[[model]]$qrank]
+ Q <- object[[model]]$QR
+ p1 <- Q$pivot[1:Q$rank]
u <- E[, p1, drop = FALSE] %*% coef(object)[p1, ,
drop = FALSE]
u <- u[, 1:take, drop = FALSE]
Modified: pkg/R/predict.rda.R
===================================================================
--- pkg/R/predict.rda.R 2008-06-08 16:06:53 UTC (rev 402)
+++ pkg/R/predict.rda.R 2008-06-09 04:20:30 UTC (rev 403)
@@ -44,7 +44,8 @@
object$terminfo$xlev)
E <- cbind(d$Z, d$Y)
}
- p1 <- object[[model]]$QR$pivot[1:object[[model]]$qrank]
+ Q <- object[[model]]$QR
+ p1 <- Q$pivot[1:Q$rank]
E <- sweep(E, 2, c(object$pCCA$envcentre, object$CCA$envcentre),
"-")
u <- E[, p1, drop = FALSE] %*% coef(object)[p1, ,
Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog 2008-06-08 16:06:53 UTC (rev 402)
+++ pkg/inst/ChangeLog 2008-06-09 04:20:30 UTC (rev 403)
@@ -15,11 +15,14 @@
cca objects are handled by many other functions, this may cause
trouble in surprising places and the change is unstabilizing.
- * rda.default, cca.default: return now both 'rank' for the
- ordination, and 'qrank' or the rank of the constrainst. This means
- following changes in functions using ranks:
+ * rda.default, cca.default: vegan naively used only the rank of
+ the ordination, but indeed, there are three cases of ranks
+ (returned as rank): rank of the ordination or number of axes, rank
+ of the constraints after conditions (now returned as qrank), rank
+ of conditions + constraints (returned in QR$rank). The following
+ changes were made if necessary to cca/rda support functions:
- * alias.cca: qrank
+ * alias.cca: QR$rank
* anova.ccabyaxis: OK
* bstick.cca: OK
* calibrate.cca: stop with error if qrank > rank
@@ -27,7 +30,7 @@
* mso: OK (HW confirms)
* msoplot: OK (HW cofirms)
* permutest.cca: qrank, also fixes anova.ccabyterm
- * predict.cca/rda: qrank with type = "lc"
+ * predict.cca/rda: QR$rank with type = "lc" & newdata
* summary.cca/rda: OK
* scores.cca/rda: OK
More information about the Vegan-commits
mailing list