[Vegan-commits] r1676 - in pkg/vegan: R inst man tests/Examples

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 5 08:07:24 CEST 2011


Author: jarioksa
Date: 2011-07-05 08:07:23 +0200 (Tue, 05 Jul 2011)
New Revision: 1676

Modified:
   pkg/vegan/R/metaMDS.R
   pkg/vegan/R/metaMDSdist.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/metaMDS.Rd
   pkg/vegan/tests/Examples/vegan-Ex.Rout.save
Log:
adapt metaMDS to monoMDS: doc, 'noshare' defaults

Modified: pkg/vegan/R/metaMDS.R
===================================================================
--- pkg/vegan/R/metaMDS.R	2011-07-03 13:52:17 UTC (rev 1675)
+++ pkg/vegan/R/metaMDS.R	2011-07-05 06:07:23 UTC (rev 1676)
@@ -1,8 +1,11 @@
 `metaMDS` <-
-    function (comm, distance = "bray", k = 2, trymax = 20, autotransform = TRUE, 
-              noshare = 0.1, wascores = TRUE, expand = TRUE, trace = 1,
+    function (comm, distance = "bray", k = 2, trymax = 20,
+              engine = c("monoMDS", "isoMDS"), 
+              autotransform = TRUE, noshare = (engine == "isoMDS"),
+              wascores = TRUE, expand = TRUE, trace = 1,
               plot = FALSE, previous.best,  ...) 
 {
+    engine <- match.arg(engine)
     commname <- deparse(substitute(comm))
     ## metaMDS was written for community data which should be all
     ## positive. Check this here, and set arguments so that they are
@@ -32,7 +35,8 @@
     if (missing(previous.best)) 
         previous.best <- NULL
     out <- metaMDSiter(dis, k = k, trymax = trymax, trace = trace, 
-                       plot = plot, previous.best = previous.best, ...)
+                       plot = plot, previous.best = previous.best,
+                       engine = engine, ...)
     points <- postMDS(out$points, dis, plot = max(0, plot - 1), ...)
     if (is.null(rownames(points))) 
         rownames(points) <- rownames(comm)

Modified: pkg/vegan/R/metaMDSdist.R
===================================================================
--- pkg/vegan/R/metaMDSdist.R	2011-07-03 13:52:17 UTC (rev 1675)
+++ pkg/vegan/R/metaMDSdist.R	2011-07-05 06:07:23 UTC (rev 1676)
@@ -48,7 +48,9 @@
     ## has distance = 1.
     maxdis <- abs(distfun(matrix(c(7,0,0,3), 2, 2),
                       method = distance, ...) - 1) < 1e-4
-    if (noshare > 0 && sum(tmp <- no.shared(comm))/length(dis) > noshare) {
+    if ((isTRUE(noshare) && any(tmp <- no.shared(comm))) ||
+        (noshare > 0 &&
+         sum(tmp <- no.shared(comm))/length(dis) > noshare)) {
         if (trace) 
             cat("Using step-across dissimilarities:\n")
         rn <- range(dis[tmp], na.rm = TRUE)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-07-03 13:52:17 UTC (rev 1675)
+++ pkg/vegan/inst/ChangeLog	2011-07-05 06:07:23 UTC (rev 1676)
@@ -4,11 +4,17 @@
 
 Version 1.90-1 (opened July 3, 2011)
 
-	* metaMDS: remove argument 'old.wa'. This was introduced in rev280
-	(24/3/08) for backward compatibility when calculating WA scores
-	started to use the same transformed data as the dissimilarities
-	analysed. 
-	
+	* metaMDS: Documentation and interface adapted to monoMDS().
+	Argument 'noshare' defaults to FALSE with monoMDS(), since tie
+	breaking seem to handle tied maximum dissimilarities even better
+	than stepacross(). For 'engine = "monoMDS"' 'noshare' defaults to
+	TRUE. The 'noshare' argument now accepts logical arguments in
+	addition to old numeric (FALSE worked previously because it was
+	interpreted as numeric 0, but TRUE has now meaningful
+	interpretation). Remove argument 'old.wa' introduced in rev280 on
+	24/3/08 for backward compatibility when calculating WA scores
+	started to use the same transformed data as analysed.
+	 
 Version 1.90-0 (closed July 3, 2011)
 
 	* vegan now depends on the permute package for new permutation

Modified: pkg/vegan/man/metaMDS.Rd
===================================================================
--- pkg/vegan/man/metaMDS.Rd	2011-07-03 13:52:17 UTC (rev 1675)
+++ pkg/vegan/man/metaMDS.Rd	2011-07-05 06:07:23 UTC (rev 1676)
@@ -1,3 +1,4 @@
+\encoding{UTF-8}
 \name{metaMDS}
 \alias{metaMDS}
 \alias{metaMDSdist}
@@ -14,34 +15,37 @@
 
 \title{Nonmetric Multidimensional Scaling with Stable Solution from
   Random Starts, Axis Scaling and Species Scores}
-\description{
-  Function \code{metaMDS} uses \code{\link[MASS]{isoMDS}} to perform
-  Nonmetric Multidimensional Scaling (NMDS), but tries to find a stable
-  solution using several random starts (function \code{initMDS}). In
-  addition, it standardizes the scaling in
-  the result, so that the configurations are easier
-  to interpret (function \code{postMDS}), and adds species scores to the
-  site ordination (function \code{\link{wascores}}). 
-}
+
+\description{Function \code{metaMDS} performs Nonmetric
+  Multidimensional Scaling (NMDS), and tries to find a stable solution
+  using several random starts. In addition, it standardizes the
+  scaling in the result, so that the configurations are easier to
+  interpret, and adds species scores to the site ordination. The
+  \code{metaMDS} function does not provide actual NMDS, but it calls
+  another function for the purpose. Currently \code{\link{monoMDS}} is
+  the default choice, and it is also possible to call the
+  \code{\link[MASS]{isoMDS}} (\pkg{MASS} package). }
+
 \usage{
-metaMDS(comm, distance = "bray", k = 2, trymax = 20, autotransform =TRUE,
-        noshare = 0.1, wascores = TRUE, expand = TRUE, trace = 1,
-        plot = FALSE, previous.best,  ...)
+metaMDS(comm, distance = "bray", k = 2, trymax = 20, 
+    engine = c("monoMDS", "isoMDS"), autotransform =TRUE,
+    noshare = (engine == "isoMDS"), wascores = TRUE, expand = TRUE, 
+    trace = 1, plot = FALSE, previous.best,  ...)
 \method{plot}{metaMDS}(x, display = c("sites", "species"), choices = c(1, 2),
-     type = "p", shrink = FALSE,  ...)
+    type = "p", shrink = FALSE,  ...)
 \method{points}{metaMDS}(x, display = c("sites", "species"),
-        choices = c(1,2), shrink = FALSE, select, ...)
+    choices = c(1,2), shrink = FALSE, select, ...)
 \method{text}{metaMDS}(x, display = c("sites", "species"), labels, 
-        choices = c(1,2), shrink = FALSE, select, ...)
+    choices = c(1,2), shrink = FALSE, select, ...)
 \method{scores}{metaMDS}(x, display = c("sites", "species"), shrink = FALSE, 
-        choices, ...)
+    choices, ...)
 metaMDSdist(comm, distance = "bray", autotransform = TRUE, noshare = 0.1, 
     trace = 1, commname, zerodist = "ignore", distfun = vegdist, ...)
-metaMDSiter(dist, k = 2, trymax = 20, trace = 1, plot = FALSE, previous.best, 
-    engine = "monoMDS", ...)   
+metaMDSiter(dist, k = 2, trymax = 20, trace = 1, plot = FALSE, 
+    previous.best, engine = "monoMDS", ...)   
 initMDS(x, k=2)
 postMDS(X, dist, pc=TRUE, center=TRUE, halfchange, threshold=0.8,
-        nthreshold=10, plot=FALSE, ...)
+    nthreshold=10, plot=FALSE, ...)
 metaMDSredist(object, ...)
 metaMDSrotate(object, vec, na.rm = FALSE, ...)
 }
@@ -55,11 +59,30 @@
   \item{k}{Number of dimensions in \code{\link[MASS]{isoMDS}}.}
   \item{trymax}{Maximum number of random starts in search of stable
     solution.}
+
+  \item{engine}{The function used for MDS. The default is to use the
+    \code{\link{monoMDS}} function in \pkg{vegan}, but for backward
+    compatibility it is also possible to use \code{\link{isoMDS}} of
+    \pkg{MASS}.}
+
   \item{autotransform}{Use simple heuristics for possible data
-    transformation (see below).}
-  \item{noshare}{Proportion of site pairs with no shared species to
-    trigger \code{\link{stepacross}} to find flexible shortest paths
-    among dissimilarities.}
+    transformation of typical community data (see below). If you do
+    not have community data, you should probably set
+    \code{autotransform = FALSE}.}
+
+  \item{noshare}{Triggering of calculation step-across or extended
+    dissimilarities with function \code{\link{stepacross}}. The
+    argument can be logical or a numerical value greater than zero
+    and less than one. If \code{TRUE}, extended dissimilarities are
+    used always when there are no shared species between some sites,
+    if \code{FALSE}, they are never used. If \code{noshare} is a
+    numerical value, \code{\link{stepacross}} is used when the
+    proportion of site pairs with no shared species exceeds
+    \code{noshare}. The number of pairs with no shared species is
+    found with \code{\link{no.shared}} function, and \code{noshare}
+    has no effect if input data were dissimilarities instead of
+    community data.}
+
   \item{wascores}{Calculate species scores using function
     \code{\link{wascores}}.}
   \item{expand}{Expand weighted averages of species in
@@ -68,11 +91,11 @@
     more voluminous.}
   \item{plot}{Graphical tracing: plot interim results. You may want to set
     \code{par(ask = TRUE)} with this option.}
-  \item{previous.best}{Start searches from a previous
-    solutions. Otherwise use \code{\link[MASS]{isoMDS}} default for the
-    starting solution.}
-  \item{x}{Dissimilarity matrix for \code{\link[MASS]{isoMDS}} or \code{plot}
-    object.} 
+  \item{previous.best}{Start searches from a previous solution.}
+
+  \item{x}{\code{metaMDS} result (or a dissimilarity structure for
+  \code{initMDS}.}
+
   \item{choices}{Axes shown.}
   \item{type}{Plot type: \code{"p"} for points, \code{"t"} for text, and
    \code{"n"} for axes only.}
@@ -86,16 +109,18 @@
  \item{X}{Configuration from multidimensional scaling. }
  \item{commname}{The name of \code{comm}: should not be given if the
    function is called directly.}
- \item{zerodist}{Handling of zero dissimilarities: either \code{"fail"}
-   or \code{"add"} a small positive value, or \code{"ignore"}.}
+
+ \item{zerodist}{Handling of zero dissimilarities: either
+   \code{"fail"} or \code{"add"} a small positive value, or
+   \code{"ignore"}. \code{\link{monoMDS}} accepts zero dissimilarities
+   and the default is \code{zerodist = "ignore"}, but with
+   \code{\link[MASS]{isoMDS}} you may need to set \code{zerodist =
+   "add"}.}
+
  \item{distfun}{Dissimilarity function. Any function returning a
    \code{dist} object and accepting argument \code{method} can be used
    (but some extra arguments may cause name conflicts).}
  \item{dist}{Dissimilarity matrix used in multidimensional scaling. }
-  \item{engine}{The function used for non-metric MDS. The default is to
-     use the \code{\link{monoMDS}} function in \pkg{vegan}, but for 
-     backward compatibility it is also possible to use \code{\link{isoMDS}}
-     of \pkg{MASS}.}			   
   \item{pc}{Rotate to principal components. }
   \item{center}{Centre the configuration. }
  \item{halfchange}{Scale axes to half-change units. This defaults
@@ -108,118 +133,141 @@
  \item{object}{A result object from \code{metaMDS}.}
  \item{vec}{A continuous site variable (vector).}
  \item{na.rm}{Remove missing values from continuous variable \code{vec}.}
- \item{...}{Other parameters passed to functions.}
+ 
+  \item{\dots}{Other parameters passed to functions. Function
+    \code{metaMDS} passes all arguments to its component functions
+    \code{metaMDSdist}, \code{metaMDSiter}, \code{postMDS}, and to
+    \code{distfun} and \code{engine}.}  
 }
 
 \details{ Non-metric Multidimensional Scaling (NMDS) is commonly
   regarded as the most robust unconstrained ordination method in
-  community ecology (Minchin 1987).  Functions \code{initMDS} and
-  \code{postMDS} together with some other functions are intended to
-  help run NMDS with \code{\link{monoMDS}} (or optinally with
-  \code{\link[MASS]{isoMDS}}) like recommended by Minchin (1987).
-  Function \code{metaMDS} combines all recommendations into one
-  command for a shotgun style analysis. The complete steps in
-  \code{metaMDS} are:
-  \enumerate{
-    \item Transformation: If the data values are larger than common
-    class scales, the function performs a Wisconsin double
-    standardization using \code{\link{wisconsin}}.  If the values look
+  community ecology (Minchin 1987).  Function \code{metaMDS} is a
+  wrapper function that calls several other functions to combine
+  Minchin's (1987) recommendations into one command. The complete
+  steps in \code{metaMDS} are:
+  
+\enumerate{ 
+
+  \item Transformation: If the data values are larger than common
+    abundance class scales, the function performs a Wisconsin double
+    standardization (\code{\link{wisconsin}}).  If the values look
     very large, the function also performs \code{\link{sqrt}}
-    transformation. Both of these standardization are generally found
+    transformation. Both of these standardizations are generally found
     to improve the results. However, the limits are completely
     arbitrary (at present, data maximum 50 triggers \code{\link{sqrt}}
-    and >9 triggers \code{\link{wisconsin}}). If you want to have a full
-    control of the analysis, you
-    should set \code{autotransform = FALSE} and make explicit
-    standardization in the command.
+    and \eqn{>9} triggers \code{\link{wisconsin}}). If you want to
+    have a full control of the analysis, you should set
+    \code{autotransform = FALSE} and standardize and transform data
+    independently. The \code{autotransform} is intended for community
+    data, and for other data types, you should set \code{autotransform
+    = FALSE}. This step is perfomed using \code{metaMDSdist}.
 
-    \item Choice of dissimilarity: For a good result, you should use
+  \item Choice of dissimilarity: For a good result, you should use
     dissimilarity indices that have a good rank order relation to
-    ordering sites along gradients (Faith et al. 1987).
-    The default is Bray dissimilarity, because it often is the test
-    winner. However, any other
-    dissimilarity index in \code{\link{vegdist}} can be used. Function
-    \code{\link{rankindex}} can be used for finding the test winner for
-    you data and gradients.
+    ordering sites along gradients (Faith et al. 1987).  The default
+    is Bray-Curtis dissimilarity, because it often is the test
+    winner. However, any other dissimilarity index in
+    \code{\link{vegdist}} can be used. Function
+    \code{\link{rankindex}} can be used for finding the test winner
+    for you data and gradients. The default choice may be bad if you
+    analyse other than community data, and you should probably select
+    an appropriate index using argument \code{distance}.  This step is
+    performed using \code{metaMDSdist}.
 
-    \item Step-across dissimilarities: Ordination may be very difficult
-    if a large proportion of sites have no shared species. In this case,
-    the results may be improved with \code{\link{stepacross}}
-    dissimilarities, or flexible shortest paths among all sites. The
+  \item Step-across dissimilarities: Ordination may be very difficult
+    if a large proportion of sites have no shared species. In this
+    case, the results may be improved with \code{\link{stepacross}}
+    dissimilarities, or flexible shortest paths among all sites.  The
+    default NMDS \code{engine} is \code{\link{monoMDS}} which is able
+    to break tied values at the maximum dissimilarity, and this often
+    is sufficient to handle cases with no shared species, and
+    therefore the default is not to use \code{\link{stepacross}} with
+    \code{\link{monoMDS}}.  Function \code{\link[MASS]{isoMDS}} does
+    not handle tied values adequately, and therefore the default is to
+    use \code{\link{stepacross}} always when there are sites with no
+    shared species with \code{engine = "isoMDS"}. The
     \code{\link{stepacross}} is triggered by option \code{noshare}. If
     you do not like manipulation of original distances, you should set
-    \code{noshare = 1}.  
+    \code{noshare = FALSE}.  This step is skipped if input data were
+    dissimilarities instead of community data. This step is performed
+    using \code{metaMDSdist}.
 
-    \item NMDS with random starts: NMDS easily gets trapped into local
-    optima, and you must start NMDS several times from random start to
-    be confident that you have found the global solution. An often-used
-    default  is to start from
-    metric scaling (with \code{\link{cmdscale}}) which typically is
-    close to a local optimum. The strategy in \code{metaMDS} is to first
-    run NMDS starting with the metric scaling, or use the
-    \code{previous.best} solution if supplied, and take
-    its solution as the standard (\code{Run 0}). Then \code{metaMDS}
-    starts NMDS from several
-    random starts (maximum number is given by \code{trymax}). If a
-    solution is better (has a lower stress) than the previous standard,
-    it is taken as the new standard. If the solution is better or close
-    to a standard, \code{metaMDS} compares two solutions using
-    Procrustes analysis using function \code{\link{procrustes}} with
-    option \code{symmetric = TRUE}. If the two solutions are very
-    similar in their Procrustes \code{rmse} and the largest residual is
-    very small, the solutions are regarded as convergent and the best
-    one is saved. Please note that the conditions are stringent, and you
-    may have found good and relatively stable solutions although the
-    function is not yet satisfied. Setting \code{trace = TRUE} will
-    monitor the final stresses, and \code{plot = TRUE} will display
-    Procrustes overlay plots from each comparison. This is the only
-    step performed if input data (\code{comm}) were dissimilarities. 
+  \item NMDS with random starts: NMDS easily gets trapped into local
+    optima, and you must start NMDS several times from random starts
+    to be confident that you have found the global solution. The
+    strategy in \code{metaMDS} is to first run NMDS starting with the
+    metric scaling (\code{\link{cmdscale}} which usually finds a good
+    solution but often close to a local optimum), or use the
+    \code{previous.best} solution if supplied, and take its solution
+    as the standard (\code{Run 0}). Then \code{metaMDS} starts NMDS
+    from several random starts (maximum number is given by
+    \code{trymax}). Function \code{\link{monoMDS}} defaults random
+    starts, but \code{\link{isoMDS}} defaults to
+    \code{\link{cmdscale}}, and there random starts are generated by
+    \code{initMDS}. If a solution is better (has a lower stress) than
+    the previous standard, it is taken as the new standard. If the
+    solution is better or close to a standard, \code{metaMDS} compares
+    two solutions using Procrustes analysis (function
+    \code{\link{procrustes}} with option \code{symmetric = TRUE}). If
+    the solutions are very similar in their Procrustes \code{rmse} and
+    the largest residual is very small, the solutions are regarded as
+    convergent and the better one is taken as the new standard. Please
+    note that the conditions are stringent, and you may have found
+    good and relatively stable solutions although the function is not
+    yet satisfied. Setting \code{trace = TRUE} will monitor the final
+    stresses, and \code{plot = TRUE} will display Procrustes overlay
+    plots from each comparison. This step is performed using
+    \code{metaMDSiter}. This is the only step performed if input data
+    (\code{comm}) were dissimilarities.
 
-    \item Scaling of the results: \code{metaMDS} will run
-    \code{postMDS} for the final result. Function \code{postMDS}
-    provides the following ways of ``fixing'' the indeterminacy of
-    scaling and orientation of axes in NMDS: Centring moves the origin
-    to the average of the axes.  Principal components rotate the
-    configuration so that the variance of points is maximized on first
-    dimension (with function \code{metaMDSrotate} you can
-    alternatively rotate the configuration so that the first axis is
-    parallel to an environmental variable).  Half-change scaling
-    scales the configuration so that one unit means halving of
-    community similarity from replicate similarity.  Half-change
-    scaling is based on closer dissimilarities where the relation
-    between ordination distance and community dissimilarity is rather
-    linear; the limit is controlled by parameter \code{threshold}.  If
-    there are enough points below this threshold (controlled by the
-    parameter \code{nthreshold}), dissimilarities are regressed on
-    distances.  The intercept of this regression is taken as the
-    replicate dissimilarity, and half-change is the distance where
-    similarity halves according to linear regression.  Obviously the
-    method is applicable only for dissimilarity indices scaled to
-    \eqn{0 \ldots 1}, such as Kulczynski, Bray-Curtis and Canberra
-    indices. If half-change scaling is not used, the ordination is
-    scaled to the same range as the original dissimilarities.
+  \item Scaling of the results: \code{metaMDS} will run \code{postMDS}
+    for the final result. Function \code{postMDS} provides the
+    following ways of \dQuote{fixing} the indeterminacy of scaling and
+    orientation of axes in NMDS: Centring moves the origin to the
+    average of the axes; Principal components rotate the configuration
+    so that the variance of points is maximized on first dimension
+    (with function \code{metaMDSrotate} you can alternatively rotate
+    the configuration so that the first axis is parallel to an
+    environmental variable); Half-change scaling scales the
+    configuration so that one unit means halving of community
+    similarity from replicate similarity.  Half-change scaling is
+    based on closer dissimilarities where the relation between
+    ordination distance and community dissimilarity is rather linear
+    (the limit is set by argument \code{threshold}). If there are
+    enough points below this threshold (controlled by the parameter
+    \code{nthreshold}), dissimilarities are regressed on distances.
+    The intercept of this regression is taken as the replicate
+    dissimilarity, and half-change is the distance where similarity
+    halves according to linear regression.  Obviously the method is
+    applicable only for dissimilarity indices scaled to \eqn{0 \ldots
+    1}, such as Kulczynski, Bray-Curtis and Canberra indices. If
+    half-change scaling is not used, the ordination is scaled to the
+    same range as the original dissimilarities.
 
-    \item Species scores: Function adds the species scores to the final
+  \item Species scores: Function adds the species scores to the final
     solution as weighted averages using function
-    \code{\link{wascores}} with given value of parameter \code{expand}.
-    The expansion of  weighted averages can be undone with \code{shrink
-      = TRUE} in \code{plot} or \code{scores} functions, and the
-    calculation of species scores can be suppressed with \code{wascores
-    = FALSE}. 
-  }
+    \code{\link{wascores}} with given value of parameter
+    \code{expand}.  The expansion of weighted averages can be undone
+    with \code{shrink = TRUE} in \code{plot} or \code{scores}
+    functions, and the calculation of species scores can be suppressed
+    with \code{wascores = FALSE}.
+} 
 }
 
 \value{ Function \code{metaMDS} returns an object of class
   \code{metaMDS}. The final site ordination is stored in the item
   \code{points}, and species ordination in the item
   \code{species}. The other items store the information on the steps
-  taken by the function. The object has \code{print}, \code{plot},
-  \code{points} and \code{text} methods.  Functions \code{metaMDSdist}
-  and \code{metaMDSredist} return \code{\link{vegdist}} objects.
-  Function \code{initMDS} returns a random configuration which is
-  intended to be used within \code{\link[MASS]{isoMDS}} only.
-  Functions \code{metaMDSiter} and \code{postMDS} returns the result
-  of NMDS with updated configuration.  }
+  taken and the items returned by the \code{engine} function. The
+  object has \code{print}, \code{plot}, \code{points} and \code{text}
+  methods.  Functions \code{metaMDSdist} and \code{metaMDSredist}
+  return \code{\link{vegdist}} objects.  Function \code{initMDS}
+  returns a random configuration which is intended to be used within
+  \code{\link[MASS]{isoMDS}} only.  Functions \code{metaMDSiter} and
+  \code{postMDS} returns the result of NMDS with updated
+  configuration.  
+}
 
 
 \references{
@@ -236,27 +284,31 @@
 
 \note{ Function \code{metaMDS} is a simple wrapper for an NMDS engine
   (either \code{\link{monoMDS}} or \code{\link[MASS]{isoMDS}}) and
-  some support functions.  You can call these support functions
-  separately for better control of results.  Data transformation,
-  dissimilarities and possible \code{\link{stepacross}} are made in
-  function \code{metaMDSdist} which returns a dissimilarity
-  result. Iterative search (with starting values from \code{initMDS})
-  is made in \code{metaMDSiter}.  Processing of result configuration
-  is done in \code{postMDS}, and species scores added by
+  some support functions (\code{metaMDSdist},
+  \code{\link{stepacross}}, \code{metaMDSiter}, \code{initMDS},
+  \code{postMDS}, \code{\link{wascores}}).  You can call these support
+  functions separately for better control of results.  Data
+  transformation, dissimilarities and possible
+  \code{\link{stepacross}} are made in function \code{metaMDSdist}
+  which returns a dissimilarity result. Iterative search (with
+  starting values from \code{initMDS} with \code{\link{monoMDS}}) is
+  made in \code{metaMDSiter}.  Processing of result configuration is
+  done in \code{postMDS}, and species scores added by
   \code{\link{wascores}}.  If you want to be more certain of reaching
   a global solution, you can compare results from several independent
   runs. You can also continue analysis from previous results or from
   your own configuration.  Function may not save the used
-  dissimilarity matrix, but \code{metaMDSredist} tries to reconstruct
-  the used dissimilarities with original data transformation and
-  possible \code{\link{stepacross}}.
+  dissimilarity matrix (\code{\link{monoMDS}} does), but
+  \code{metaMDSredist} tries to reconstruct the used dissimilarities
+  with original data transformation and possible
+  \code{\link{stepacross}}.
 
   The \code{metaMDS} function was designed to be used with community
   data.  If you have other type of data, you should probably set some
   arguments to non-default values: probably at least \code{wascores},
   \code{autotransform} and \code{noshare} should be \code{FALSE}. If
   you have negative data entries, \code{metaMDS} will set the previous
-  to \code{FALSE} with a warning.
+  to \code{FALSE} with a warning.  
 }
 
 \section{Warning}{ \code{metaMDS} used \code{\link[MASS]{isoMDS}} as
@@ -264,6 +316,7 @@
   the \code{\link{monoMDS}} function. You can set argument
   \code{engine} to select the old engine.
 }
+
 \seealso{\code{\link{monoMDS}} (and \code{\link[MASS]{isoMDS}}), 
   \code{\link{decostand}},
   \code{\link{wisconsin}}, 
@@ -276,12 +329,10 @@
 ## The recommended way of running NMDS (Minchin 1987)
 ##
 data(dune)
-library(MASS) ## isoMDS
-# NMDS
+# Global NMDS using monoMDS
 sol <- metaMDS(dune)
 sol
 plot(sol, type="t")
-
 ## Start from previous best solution
 sol2 <- metaMDS(dune, previous.best = sol)
 }

Modified: pkg/vegan/tests/Examples/vegan-Ex.Rout.save
===================================================================
--- pkg/vegan/tests/Examples/vegan-Ex.Rout.save	2011-07-03 13:52:17 UTC (rev 1675)
+++ pkg/vegan/tests/Examples/vegan-Ex.Rout.save	2011-07-05 06:07:23 UTC (rev 1676)
@@ -3412,8 +3412,7 @@
 > ## The recommended way of running NMDS (Minchin 1987)
 > ##
 > data(dune)
-> library(MASS) ## isoMDS
-> # NMDS
+> # Global NMDS using monoMDS
 > sol <- metaMDS(dune)
 Run 0 stress 0.1192691 
 Run 1 stress 0.1808932 
@@ -3441,7 +3440,6 @@
 Species: expanded scores based on ‘dune’ 
 
 > plot(sol, type="t")
-> 
 > ## Start from previous best solution
 > sol2 <- metaMDS(dune, previous.best = sol)
 Starting from 2-dimensional configuration
@@ -3456,9 +3454,6 @@
 > 
 > 
 > cleanEx()
-
-detaching ‘package:MASS’
-
 > nameEx("mite")
 > ### * mite
 > 
@@ -4618,7 +4613,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x1039ae608>
+<environment: 0x102e8a118>
 
 Estimated degrees of freedom:
 6.4351  total = 7.435071 
@@ -4634,7 +4629,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x104836a98>
+<environment: 0x1062d2808>
 
 Estimated degrees of freedom:
 6.0761  total = 7.076141 
@@ -4790,7 +4785,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x106ad6e40>
+<environment: 0x1071b84d8>
 
 Estimated degrees of freedom:
 8.9275  total = 9.927492 
@@ -4803,7 +4798,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x1061aac40>
+<environment: 0x1068b80d8>
 
 Estimated degrees of freedom:
 7.7529  total = 8.75294 
@@ -4816,7 +4811,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x106e59e78>
+<environment: 0x106b40630>
 
 Estimated degrees of freedom:
 8.8962  total = 9.89616 
@@ -7009,7 +7004,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x107ee1ae8>
+<environment: 0x1080e5a00>
 
 Estimated degrees of freedom:
 2  total = 3 
@@ -7474,7 +7469,7 @@
 > ### * <FOOTER>
 > ###
 > cat("Time elapsed: ", proc.time() - get("ptime", pos = 'CheckExEnv'),"\n")
-Time elapsed:  101.393 1.11 102.723 0 0 
+Time elapsed:  104.018 1.278 107.134 0 0 
 > grDevices::dev.off()
 null device 
           1 



More information about the Vegan-commits mailing list