[Vegan-commits] r2933 - in pkg/vegan: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Feb 23 09:41:47 CET 2015
Author: jarioksa
Date: 2015-02-23 09:41:47 +0100 (Mon, 23 Feb 2015)
New Revision: 2933
Modified:
pkg/vegan/R/cca.default.R
pkg/vegan/R/rda.default.R
pkg/vegan/man/procrustes.Rd
Log:
Merge branch 'cran-2.2' into r-forge-svn-local
Modified: pkg/vegan/R/cca.default.R
===================================================================
--- pkg/vegan/R/cca.default.R 2015-02-10 08:34:02 UTC (rev 2932)
+++ pkg/vegan/R/cca.default.R 2015-02-23 08:41:47 UTC (rev 2933)
@@ -12,6 +12,11 @@
attr(x, "centre") <- w.c
x
}
+ ## Protect against grave misuse: some people have used
+ ## dissimilarities instead of data
+ if (inherits(X, "dist") || NCOL(X) == NROW(X) &&
+ isTRUE(all.equal(X, t(X))))
+ stop("function cannot be used with (dis)similarities")
X <- as.matrix(X)
if (any(rowSums(X) <= 0))
stop("All row sums must be >0 in the community data matrix")
Modified: pkg/vegan/R/rda.default.R
===================================================================
--- pkg/vegan/R/rda.default.R 2015-02-10 08:34:02 UTC (rev 2932)
+++ pkg/vegan/R/rda.default.R 2015-02-23 08:41:47 UTC (rev 2933)
@@ -5,6 +5,11 @@
CCA <- NULL
pCCA <- NULL
CA <- NULL
+ ## Protect against grave misuse: some people have used
+ ## dissimilarities instead of data
+ if (inherits(X, "dist") || NCOL(X) == NROW(X) &&
+ isTRUE(all.equal(X, t(X))))
+ stop("function cannot be used with (dis)similarities")
X <- as.matrix(X)
NR <- nrow(X) - 1
Xbar <- scale(X, center = TRUE, scale = scale)
Modified: pkg/vegan/man/procrustes.Rd
===================================================================
--- pkg/vegan/man/procrustes.Rd 2015-02-10 08:34:02 UTC (rev 2932)
+++ pkg/vegan/man/procrustes.Rd 2015-02-23 08:41:47 UTC (rev 2933)
@@ -131,7 +131,7 @@
function). Function \code{predict} can be used to add new rotated
coordinates to the target. The \code{predict} function will always
translate coordinates to the original non-centred matrix. The
- function canot be used with \code{newdata} for \code{symmetric}
+ function cannot be used with \code{newdata} for \code{symmetric}
analysis.
Function \code{protest} performs symmetric Procrustes analysis
More information about the Vegan-commits
mailing list