[Vegan-commits] r1072 - in pkg/vegan: R inst
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Nov 29 10:31:51 CET 2009
Author: jarioksa
Date: 2009-11-29 10:31:48 +0100 (Sun, 29 Nov 2009)
New Revision: 1072
Modified:
pkg/vegan/R/predict.rda.R
pkg/vegan/inst/ChangeLog
Log:
predict.rda works with rank=0: returns a matrix of column centres
Modified: pkg/vegan/R/predict.rda.R
===================================================================
--- pkg/vegan/R/predict.rda.R 2009-11-28 22:09:59 UTC (rev 1071)
+++ pkg/vegan/R/predict.rda.R 2009-11-29 09:31:48 UTC (rev 1072)
@@ -31,6 +31,11 @@
} else {
if (take > 0)
out <- u %*% slam %*% t(v)
+ else {
+ out <- matrix(0, nrow = nrow(u), ncol = nrow(v))
+ rownames(out) <- rownames(u)
+ colnames(out) <- rownames(v)
+ }
if (!is.null(scal))
out <- sweep(out, 2, scal, "*")
out <- sweep(out, 2, cent, "+")
Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog 2009-11-28 22:09:59 UTC (rev 1071)
+++ pkg/vegan/inst/ChangeLog 2009-11-29 09:31:48 UTC (rev 1072)
@@ -12,7 +12,11 @@
* bstick: refuses to analyse capscale() models with imaginary
components because I have no idea how to do it. Reported by
- Richard Telford, Bergen.
+ Richard Telford, Bergen (who probably wanted another
+ solution...).
+
+ * predict.rda: works now with rank = 0 -- returns matrix of column
+ means. (Not yet done for predict.cca.)
Version 1.16-32 (closed November 13, 2009)
More information about the Vegan-commits
mailing list