[Vegan-commits] r1927 - in pkg/vegan: R inst
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Oct 3 19:30:05 CEST 2011
Author: jarioksa
Date: 2011-10-03 19:30:04 +0200 (Mon, 03 Oct 2011)
New Revision: 1927
Modified:
pkg/vegan/R/metaMDSiter.R
pkg/vegan/inst/ChangeLog
Log:
metaMDS did not reset 'tries' when 'previous.best' was from a different model
Modified: pkg/vegan/R/metaMDSiter.R
===================================================================
--- pkg/vegan/R/metaMDSiter.R 2011-10-02 16:43:28 UTC (rev 1926)
+++ pkg/vegan/R/metaMDSiter.R 2011-10-03 17:30:04 UTC (rev 1927)
@@ -30,9 +30,6 @@
else if (nc < k)
for (i in 1:(k-nc))
init <- cbind(init, runif(NROW(init), -0.1, 0.1))
- ## zero 'tries' if started from different no. of dims
- if (inherits(previous.best, "metaMDS") && nc != k)
- previous.best$tries <- 0
if (trace)
cat(gettextf("Starting from %d-dimensional configuration\n", nc))
} else {
@@ -42,6 +39,13 @@
s0 <- switch(engine,
"monoMDS" = monoMDS(dist, y = init, k = k, maxit = 0, ...),
"isoMDS" = isoMDS(dist, y = init, k = k, maxit = 0))
+ ## Check whether model changed
+ if (is.list(previous.best) && !is.null(previous.best$stress) &&
+ !isTRUE(all.equal(previous.best$stress, s0$stress))) {
+ if (trace) cat("Stress differs from 'previous.best': reset tries\n")
+ if (inherits(previous.best, "metaMDS"))
+ previous.best$tries <- 0
+ }
} else {
## no previous.best: start with cmdscale
s0 <- switch(engine,
Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog 2011-10-02 16:43:28 UTC (rev 1926)
+++ pkg/vegan/inst/ChangeLog 2011-10-03 17:30:04 UTC (rev 1927)
@@ -4,10 +4,14 @@
Version 2.1-2 (opened September 29, 20119
+ * metaMDS did not reset 'tries' when the analysis was started from
+ 'previous.best' of a different model (except when no. of dims 'k'
+ changed). I think this was a bug(let). Fixed in metaMDSiter.R.
+
* commsimulator is going to be deprecated: it is no longer used in
oecosimu() ore elsewhere in other functions. Currently, functions
make.commsim(), nullmodel() and simulate.nullmodel() do the same,
- and more. As the first step, its documenation in oecosimu.Rd is
+ and more. As the first step, its documentation in oecosimu.Rd is
moved to vegan-deprecated.Rd.
* examples: cut donw some excessively time consuming examples.
@@ -24,7 +28,7 @@
without simulations within oecosimu(), and different statistics
can be swept out based on the same set of simulated matrices.
- * permatfull/swap is using the new simulate(nullmodel(...)...)
+ * permatfull/swap is using the new simulate.nullmodel(...)
infrastructure. permatfull1 and permatswap1 removed from vegan
devel.
@@ -143,7 +147,7 @@
* raupcrick: new function to implement Raup-Crick (dissimilarity/
probability) index with unequal sampling probabilities of species.
- Brian Inouye informed about their paper (Chase et al., Ecospher
+ Brian Inouye informed about their paper (Chase et al., Exosphere
2:art24 [doi:10.1890/ES10-00117.1]; 2011) where they showed that
Raup & Crick said that we should use sampling probabilities
proportional to species frequencies in assessing their index, but
@@ -156,7 +160,7 @@
Version 2.0-0 (released September 8, 2011)
- * opened the release candidate ov vegan_2.0-0 on September 3,
+ * opened the release candidate of vegan_2.0-0 on September 3,
2011.
* some old functions used attributes(x)$which instead of more
More information about the Vegan-commits
mailing list