[Vegan-commits] r1302 - pkg/vegan/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Sep 13 22:11:48 CEST 2010
Author: jarioksa
Date: 2010-09-13 22:11:48 +0200 (Mon, 13 Sep 2010)
New Revision: 1302
Modified:
pkg/vegan/R/metaMDSdist.R
Log:
tweaking with NA distances and messages
Modified: pkg/vegan/R/metaMDSdist.R
===================================================================
--- pkg/vegan/R/metaMDSdist.R 2010-09-13 19:47:05 UTC (rev 1301)
+++ pkg/vegan/R/metaMDSdist.R 2010-09-13 20:11:48 UTC (rev 1302)
@@ -32,13 +32,13 @@
call <- attr(dis, "call")
call[[1]] <- as.name(distname)
attr(dis, "call") <- call
- if (any(dis <= 0)) {
+ if (any(dis <= 0, na.rm = TRUE)) {
if (zerodist == "fail")
stop("Zero dissimilarities are not allowed")
else if (zerodist == "add") {
zero <- min(dis[dis > 0], na.rm = TRUE)/2
dis[dis <= 0] <- zero
- warning("Zero dissimilarities changed into ", zero)
+ message("Zero dissimilarities changed into ", zero)
}
}
## We actually used maxdis to decide whether index has a closed
More information about the Vegan-commits
mailing list