[Vegan-commits] r1495 - in pkg/vegan: R inst
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Feb 16 21:40:37 CET 2011
Author: jarioksa
Date: 2011-02-16 21:40:36 +0100 (Wed, 16 Feb 2011)
New Revision: 1495
Modified:
pkg/vegan/R/procrustes.R
pkg/vegan/inst/ChangeLog
Log:
procrustes checks numbers of rows in X & Y
Modified: pkg/vegan/R/procrustes.R
===================================================================
--- pkg/vegan/R/procrustes.R 2011-02-16 17:28:57 UTC (rev 1494)
+++ pkg/vegan/R/procrustes.R 2011-02-16 20:40:36 UTC (rev 1495)
@@ -3,6 +3,9 @@
{
X <- scores(X, display = scores, ...)
Y <- scores(Y, display = scores, ...)
+ if (nrow(X) != nrow(Y))
+ stop("Matrices have different number of rows: ",
+ nrow(X), " and ", nrow(Y))
if (ncol(X) < ncol(Y)) {
warning("X has fewer axes than Y: X adjusted to comform Y\n")
addcols <- ncol(Y) - ncol(X)
Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog 2011-02-16 17:28:57 UTC (rev 1494)
+++ pkg/vegan/inst/ChangeLog 2011-02-16 20:40:36 UTC (rev 1495)
@@ -11,6 +11,9 @@
* does not use unnecessary return() plus other stylistic
twitches. This touches 24 functions, but users should see no
difference.
+
+ * procrustes: checks and reports different number of rows instead
+ of failing in crossprod() with incompatible arguments.
Version 1.18-22 (closed February 16, 2011)
More information about the Vegan-commits
mailing list