[Vegan-commits] r2940 - in pkg/vegan: inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 13 12:16:06 CET 2015


Author: jarioksa
Date: 2015-03-13 12:16:06 +0100 (Fri, 13 Mar 2015)
New Revision: 2940

Modified:
   pkg/vegan/inst/NEWS.Rd
   pkg/vegan/man/envfit.Rd
   pkg/vegan/man/ordiarrows.Rd
Log:
Merge branch 'cran-2.2' into r-forge-svn-local

NEWS, move oridArrow* docs

Modified: pkg/vegan/inst/NEWS.Rd
===================================================================
--- pkg/vegan/inst/NEWS.Rd	2015-03-12 13:56:16 UTC (rev 2939)
+++ pkg/vegan/inst/NEWS.Rd	2015-03-13 11:16:06 UTC (rev 2940)
@@ -7,30 +7,63 @@
   \subsection{BUG FIXES}{
     \itemize{
 
-      \item Constrained ordination functions \code{cca}, \code{rda}
-      and \code{capscale} are now more robust. Scoping of data set
-      names and variable names is much improved.
+      \item Constrained ordination functions \code{cca}, \code{rda} and
+      \code{capscale} are now more robust. Scoping of data set names and
+      variable names is much improved. This should fix numerous
+      long-standing problems, for instance those reported by Benedicte
+      Bachelot (in email) and Richard Telford (in Twitter), as well as
+      issues \href{https://github.com/vegandevs/vegan/issues/16}{#16}
+      and \href{https://github.com/vegandevs/vegan/issues/100}{#100} in
+      GitHub.
 
       \item Ordination functions \code{cca} and \code{rda} silently
       accepted dissimilarities as input although their analysis makes
       no sense with these methods. Dissimilarities should be analysed
       with distance-based redundancy analysis (\code{capscale}).
 
-      \item The variance of the conditional component was
-      over-estimated in \code{goodness} of \code{rda} results, and
-      results were wrong for partial RDA. The \code{goodness}
-      functions for \code{cca} and \code{rda} were both redesigned so
-      that the variation of the partial component was only combined
-      with the constrained variance, but not with the unconstrained
-      component. Previously the conditional variation was combined
-      with both components.
+      \item The variance of the conditional component was over-estimated
+      in \code{goodness} of \code{rda} results, and results were wrong
+      for partial RDA. The problems were reported in an
+      \href{https://stat.ethz.ch/pipermail/r-sig-ecology/2015-March/004936.html}{R-sig-ecology}
+      message by Christoph von Redwitz.
 
     }
   } % bug fixes
 
+  \subsection{WINDOWS}{
+    \itemize{
+
+      \item \code{orditkplot} did not add file type identifier to saved
+      graphics in Windows although that is required. The problem only
+      concerned Windows OS.
+
+    }
+  } % windows
+
   \subsection{NEW FEATURES}{
     \itemize{
 
+      \item \code{goodness} function for constrained ordination
+      (\code{cca}, \code{rda}, \code{capscale}) was redesigned. Function
+      gained argument \code{addprevious} to add the variation explained
+      by previous ordination components to axes when \code{statistic =
+      "explained"}. With this option, \code{model = "CCA"} will include
+      the variation explained by partialled-out conditions, and
+      \code{model = "CA"} will include the accumulated variation
+      explained by conditions and constraints. The former behaviour was
+      \code{addprevious = TRUE} for \code{model = "CCA"}, and
+      \code{addprevious = FALSE} for \code{model = "CA"}. The argument
+      will have no effect when \code{statistic = "distance"}, but this
+      will always show the residual distance after all previous
+      components. Formerly it displayed the residual distance only for
+      the currently analysed model.
+
+      \item Functions \code{ordiArrowMul} and \code{ordiArrowTextXY} are
+      exported and can be used in normal interactive sessions. These
+      functions are used to scale a bunch arrows to fit ordination
+      graphics, and formerly they were internal functions used within
+      other \pkg{vegan} functions.
+
       \item The \code{varpart} plots of four-component models were
       redesigned following Legendre, Borcard & Roberts \emph{Ecology}
       93, 1234--1240 (2012), and they use now four ellipses instead of

Modified: pkg/vegan/man/envfit.Rd
===================================================================
--- pkg/vegan/man/envfit.Rd	2015-03-12 13:56:16 UTC (rev 2939)
+++ pkg/vegan/man/envfit.Rd	2015-03-13 11:16:06 UTC (rev 2940)
@@ -7,6 +7,8 @@
 \alias{plot.envfit}
 \alias{scores.envfit}
 \alias{labels.envfit}
+\alias{ordiArrowMul}
+\alias{ordiArrowTextXY}
 
 \title{Fits an Environmental Vector or Factor onto an Ordination }
 \description{
@@ -24,6 +26,9 @@
 \method{scores}{envfit}(x, display, choices, ...)
 vectorfit(X, P, permutations = 0, strata = NULL, w, ...)
 factorfit(X, P, permutations = 0, strata = NULL, w, ...)
+## support functions
+ordiArrowMul(x, at = c(0,0), fill = 0.75)
+ordiArrowTextXY(x, labels, ...)
 }
 
 \arguments{
@@ -47,8 +52,15 @@
     or environmental variables. The operation is casewise: the whole
     row of data is removed if there is a missing value and 
     \code{na.rm = TRUE}.}
-  \item{x}{A result object from \code{envfit}.}
+    
+  \item{x}{A result object from \code{envfit}. For \code{ordiArrowMul}
+    and \code{ordiArrowTextXY} this must be a two-column matrix (or
+    matrix-like object) containing the coordinates of arrow heads on
+    the two plot axes, and other methods extract such a structure from
+    the \code{envfit} results.}
+    
   \item{choices}{Axes to plotted.}
+    
   \item{labels}{Change plotting labels. The argument should be a list
     with elements \code{vectors} and \code{factors} which give the new
     plotting labels. If either of these elements is omitted, the
@@ -82,6 +94,10 @@
     (with synonyms \code{"bp"} or \code{"cn"}, resp.).}
   \item{w}{Weights used in fitting (concerns mainly \code{\link{cca}}
     and \code{\link{decorana}} results which have nonconstant weights).}
+
+  \item{fill}{numeric; the proportion of the plot to fill by the span of
+    the arrows.}
+
   \item{...}{Parameters passed to \code{\link{scores}}.}
 }
 \details{
@@ -110,7 +126,7 @@
   adjusted to the current graph using a constant multiplier: this will
   keep the relative \code{r2}-scaled lengths of the arrows but tries
   to fill the current plot.  You can see the multiplier using
-  \code{vegan:::ordiArrowMul(result_of_envfit)}, and set it with the
+  \code{ordiArrowMul(result_of_envfit)}, and set it with the
   argument \code{arrow.mul}.
   
   Functions \code{vectorfit} and \code{factorfit} can be called directly.
@@ -146,7 +162,12 @@
   for the physical size of the plot, and the arrow lengths cannot be
   compared across plots. For similar scaling of arrows, you must
   explicitly set the \code{arrow.mul} argument in the \code{plot}
-  command.
+  command.  \code{ordiArrowMul} finds a multiplier to scale a bunch of
+  arrows to fill an ordination plot, and \code{ordiArrowTextXY} finds
+  the coordinates for labels of these arrows. NB.,
+  \code{ordiArrowTextXY} does not draw labels; it simply returns
+  coordinates at which the labels should be drawn for use with another
+  function, such as \code{\link{text}}.
 
   The results can be accessed with \code{scores.envfit} function which
   returns either the fitted vectors scaled by correlation coefficient or
@@ -210,6 +231,22 @@
 plot(ord, type="p")
 fit <- envfit(ord, varechem, perm = 999, display = "lc")
 plot(fit, p.max = 0.05, col = "red")
+## Scale arrows by hand to fill 80% of the plot
+## Biplot arrows by hand
+data(varespec, varechem)
+ord <- cca(varespec ~ Al + P + K, varechem)
+plot(ord, display = c("species","sites"))
+## biplot scores
+bip <- scores(ord, choices = 1:2, display = "bp")
+## scaling factor for arrows to fill 80% of plot
+(mul <- ordiArrowMul(bip, fill = 0.8))
+bip.scl <- bip * mul                    # Scale the biplot scores
+labs <- c("Al","P","K")                 # Arrow labels
+## calculate coordinate of labels for arrows
+(bip.lab <- ordiArrowTextXY(bip.scl, labels = labs))
+## draw arrows and text labels
+arrows(0, 0, bip.scl[,1], bip.scl[,2], length = 0.1)
+text(bip.lab, labels = labs)
 ## Class variables, formula interface, and displaying the
 ## inter-class variability with `ordispider', and semitransparent
 ## white background for labels (semitransparent colours are not

Modified: pkg/vegan/man/ordiarrows.Rd
===================================================================
--- pkg/vegan/man/ordiarrows.Rd	2015-03-12 13:56:16 UTC (rev 2939)
+++ pkg/vegan/man/ordiarrows.Rd	2015-03-13 11:16:06 UTC (rev 2940)
@@ -2,8 +2,6 @@
 \alias{ordiarrows}
 \alias{ordisegments}
 \alias{ordigrid}
-\alias{ordiArrowMul}
-\alias{ordiArrowTextXY}
 
 \title{Add Arrows and Line Segments to Ordination Diagrams}
 
@@ -19,10 +17,6 @@
          show.groups, label = FALSE, ...)
 ordigrid(ord, levels, replicates, display = "sites",  lty = c(1,1), 
          col = c(1,1), lwd = c(1,1), ...)
-
-ordiArrowMul(x, at = c(0,0), fill = 0.75)
-
-ordiArrowTextXY(x, labels, ...)
 }
 
 \arguments{
@@ -63,17 +57,6 @@
   \item{\dots}{Parameters passed to graphical functions such as
     \code{\link{lines}}, \code{\link{segments}}, \code{\link{arrows}},
     or to \code{\link{scores}} to select axes and scaling etc. }
-
-  \item{x}{two-column matrix (or matrix-like object) containing the
-    coordinates of arrow heads on the two plot axes.}
-
-  \item{at}{numeric vector of coordinates for the origin of the arrows.}
-
-  \item{fill}{numeric; the proportion of the plot to fill by the span of
-    the arrows.}
-
-  \item{labels}{vector of character strings of length \code{nrow(x)}
-    that are to be used to label arrows.}
 }
 
 \details{ Function \code{ordiarrows} draws \code{\link{arrows}} and
@@ -82,18 +65,10 @@
   \code{\link{segments}} both within the groups and for the
   corresponding items among the groups.
 
-  \code{ordiArrowMul} finds a multiplier to scale a bunch of arrows to
-  fill an ordination plot, and \code{ordiArrowTextXY} finds the
-  coordinates for labels of these arrows.  See \code{\link{envfit}} for
-  an application.
 }
 
 \note{These functions add graphical items to ordination graph: You must
   draw a graph first.
-
-  \code{ordiArrowTextXY} does not draw labels; it simply returns
-  coordinates at which the labels should be drawn for use with another
-  function, such as \code{\link{text}}.
 }
 \author{ Jari Oksanen }
 
@@ -116,21 +91,5 @@
 ordiarrows(mod, ditch, label = TRUE, show = c("6", "9"),
    col = 2)
 legend("topright", c("Control", "Pyrifos 44"), lty = 1, col = c(1,2))
-
-## Biplot arrows by hand
-data(varespec, varechem)
-ord <- cca(varespec ~ Al + P + K, varechem)
-plot(ord, display = c("species","sites"))
-## biplot scores
-bip <- scores(ord, choices = 1:2, display = "bp")
-## scaling factor for arrows to fill 80% of plot
-(mul <- ordiArrowMul(bip, fill = 0.8))
-bip.scl <- bip * mul                    # Scale the biplot scores
-labs <- c("Al","P","K")                 # Arrow labels
-## calculate coordinate of labels for arrows
-(bip.lab <- ordiArrowTextXY(bip.scl, labels = labs))
-## draw arrows and text labels
-arrows(0, 0, bip.scl[,1], bip.scl[,2], length = 0.1)
-text(bip.lab, labels = labs)
 }
 \keyword{aplot }



More information about the Vegan-commits mailing list