[Vegan-commits] r2956 - in pkg/vegan: R inst
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Aug 28 09:40:29 CEST 2015
Author: jarioksa
Date: 2015-08-28 09:40:29 +0200 (Fri, 28 Aug 2015)
New Revision: 2956
Modified:
pkg/vegan/R/metaMDS.R
pkg/vegan/R/metaMDSdist.R
pkg/vegan/inst/NEWS.Rd
Log:
Merge branch 'cran-2.3' into r-forge-svn-local
Modified: pkg/vegan/R/metaMDS.R
===================================================================
--- pkg/vegan/R/metaMDS.R 2015-08-26 07:03:51 UTC (rev 2955)
+++ pkg/vegan/R/metaMDS.R 2015-08-28 07:40:29 UTC (rev 2956)
@@ -6,7 +6,13 @@
plot = FALSE, previous.best, ...)
{
engine <- match.arg(engine)
- commname <- deparse(substitute(comm))
+ ## This could be a character vector of length > 1L
+ commname <- deparse(substitute(comm), width.cutoff = 500L)
+ if (length(commname) > 1L) {
+ paste(commname, collapse = "", sep = "")
+ ## deparse can add more white space, so cull 2 or more spaces to a single space
+ commname <- gsub("[ ]{2,}", " ", commname)
+ }
## metaMDS was written for community data which should be all
## positive. Check this here, and set arguments so that they are
## suitable for non-negative data.
@@ -45,13 +51,14 @@
points <- postMDS(out$points, dis, plot = max(0, plot - 1), ...)
if (is.null(rownames(points)))
rownames(points) <- rownames(comm)
- if (wascores) {
+ wa <- if (wascores) {
## transformed data
- comm <- eval.parent(parse(text=attr(dis, "commname")))
- wa <- wascores(points, comm, expand = expand)
+ ##comm <- eval.parent(parse(text=attr(dis, "commname")))
+ comm <- attr(dis, "comm")
+ wascores(points, comm, expand = expand)
+ } else {
+ NA
}
- else
- wa <- NA
out$points <- points
out$species <- wa
out$call <- match.call()
Modified: pkg/vegan/R/metaMDSdist.R
===================================================================
--- pkg/vegan/R/metaMDSdist.R 2015-08-26 07:03:51 UTC (rev 2955)
+++ pkg/vegan/R/metaMDSdist.R 2015-08-28 07:40:29 UTC (rev 2956)
@@ -64,6 +64,7 @@
}
attr(dis, "maxdis") <- maxdis
attr(dis, "commname") <- commname
+ attr(dis, "comm") <- comm
attr(dis, "function") <- distname
dis
}
Modified: pkg/vegan/inst/NEWS.Rd
===================================================================
--- pkg/vegan/inst/NEWS.Rd 2015-08-26 07:03:51 UTC (rev 2955)
+++ pkg/vegan/inst/NEWS.Rd 2015-08-28 07:40:29 UTC (rev 2956)
@@ -2,6 +2,45 @@
\title{vegan News}
\encoding{UTF-8}
+\section{Changes in version 2.3-1}{
+
+ \subsection{BUG FIXES}{
+ \itemize{
+
+ \item Automated model building in constrained ordination
+ (\code{cca}, \code{rda}, \code{capscale}) with \code{step},
+ \code{ordistep} and \code{ordiR2step} could fail if there were
+ aliased candidate variables, or constraints that were completely
+ explained by other variables already in the model. This was a
+ regression introduced in \pkg{vegan} 2.2-0.
+
+ \item Constrained ordination methods \code{cca}, \code{rda} and
+ \code{capscale} treat character variables as factors in analysis,
+ but did not return their centroids for plotting.
+
+ \item Recovery of original data in \code{metaMDS} when computing
+ WA scores for species would fail if the expression supplied to
+ argument \code{comm} was long & got deparsed to multiple
+ strings. \code{metaMDSdist} now returns the (possibly modified)
+ data frame of community data \code{comm} as attribute
+ \code{"comm"} of the returned \code{dist} object. \code{metaMDS}
+ now uses this to compute the WA species scores for the NMDS. In
+ addition, the deparsed expression for \code{comm} is now robust to
+ long expressions. Reported by Richard Telford.
+
+ \item Function \code{rarecurve} did not check its input and this
+ could cause confusing error messages. Now function checks that
+ input data are integers that can be interpreted as counts on
+ individuals and all sampling units have some species. Unchecked
+ bad inputs were the reason for problems reported in
+ \href{http://stackoverflow.com/questions/30856909/error-while-using-rarecurve-in-r}{Stackoverflow (Error while using rarecurve)}.
+
+ }
+
+ }
+
+}
+
\section{Changes in version 2.3-0}{
\subsection{BUG FIXES}{
More information about the Vegan-commits
mailing list