[Vegan-commits] r1681 - in pkg/vegan: man tests/Examples

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jul 16 14:26:47 CEST 2011


Author: jarioksa
Date: 2011-07-16 14:26:47 +0200 (Sat, 16 Jul 2011)
New Revision: 1681

Added:
   pkg/vegan/man/ordiarrows.Rd
Modified:
   pkg/vegan/man/ordihull.Rd
   pkg/vegan/tests/Examples/vegan-Ex.Rout.save
Log:
split documentation of ordiarrows/segments/grid from ordihull/ellipse/spider/cluster

Added: pkg/vegan/man/ordiarrows.Rd
===================================================================
--- pkg/vegan/man/ordiarrows.Rd	                        (rev 0)
+++ pkg/vegan/man/ordiarrows.Rd	2011-07-16 12:26:47 UTC (rev 1681)
@@ -0,0 +1,90 @@
+\name{ordiarrows}
+\alias{ordiarrows}
+\alias{ordisegments}
+\alias{ordigrid}
+
+\title{Add Arrows and Line Segments to Ordination Diagrams}
+
+\description{ Functions to add arrows, line segments, regular grids of
+  points. The ordination diagrams can be produced by \code{vegan}
+  \code{\link{plot.cca}}, \code{\link{plot.decorana}} or
+  \code{\link{ordiplot}}.  }
+
+\usage{
+ordiarrows(ord, groups, levels, replicates, display = "sites",
+         show.groups, startmark, label = FALSE, ...)
+ordisegments(ord, groups, levels, replicates, display = "sites",
+         show.groups, label = FALSE, ...)
+ordigrid(ord, levels, replicates, display = "sites",  lty = c(1,1), 
+         col = c(1,1), lwd = c(1,1), ...)
+}
+
+\arguments{
+  \item{ord}{An ordination object or an \code{\link{ordiplot}} object. }
+  \item{groups}{Factor giving the groups for which the graphical item is
+    drawn. }
+  \item{levels, replicates}{Alternatively, regular
+    groups can be defined with arguments \code{levels} and
+    \code{replicates}, where \code{levels} gives the number of groups,
+    and \code{replicates} the number of successive items at the same
+    group.}
+  \item{display}{Item to displayed. }
+  \item{show.groups}{Show only given groups. This can be a vector, or
+    \code{TRUE} if you want to show items for which condition is
+    \code{TRUE}. This argument makes it possible to use different
+    colours and line types for groups. The default is to show all groups. }
+  \item{label}{Label the \code{groups} by their names. In
+    \code{ordiellipse}, \code{ordihull} and \code{ordispider} the the
+    group name is in the centroid of the object, in \code{ordiarrows}
+    in the start of the arrow, and in \code{ordisegments} at both
+    ends. \code{ordiellipse} and \code{ordihull} use standard
+    \code{\link{text}}, and others use \code{\link{ordilabel}}.}
+  
+  \item{startmark}{plotting character used to mark the first item. The
+    default is to use no mark, and for instance, \code{startmark = 1}
+    will draw a circle.  For other plotting characters, see \code{pch}
+    in \code{\link{points}}. }
+
+  \item{col}{Colour of lines in \code{ordigrid}.  This argument is
+    also passed to other functions to change the colour of lines.}
+
+  \item{lty, lwd}{Line type, line width used for 
+    \code{level}s and \code{replicate}s in \code{ordigrid}.}
+
+  \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. } 
+}
+
+\details{ Function \code{ordiarrows} draws \code{\link{arrows}} and
+  \code{ordisegments} draws line \code{\link{segments}} between
+  successive items in the groups. Function \code{ordigrid} draws line
+  \code{\link{segments}} both within the groups and for the
+  corresponding items among the groups.  }
+
+\note{These functions add graphical items to ordination graph: You must
+  draw a graph first.
+  }
+\author{ Jari Oksanen }
+
+\seealso{The functions pass parameters to basic graphical functions, and
+  you may wish to change the default values in \code{\link{arrows}},
+  \code{\link{lines}} and \code{\link{segments}}. You can pass
+  parameters to \code{\link{scores}} as well. 
+}
+
+\examples{
+example(pyrifos)
+mod <- rda(pyrifos)
+plot(mod, type = "n")
+## Annual succession by ditches
+ordiarrows(mod, ditch, label = TRUE)
+## Show only control and highest Pyrifos treatment
+plot(mod, type = "n")
+ordiarrows(mod, ditch, label = TRUE, 
+   show.groups = c("2", "3", "5", "11"))
+ordiarrows(mod, ditch, label = TRUE, show = c("6", "9"),
+   col = 2)
+legend("topright", c("Control", "Pyrifos 44"), lty = 1, col = c(1,2))
+}
+\keyword{aplot }

Modified: pkg/vegan/man/ordihull.Rd
===================================================================
--- pkg/vegan/man/ordihull.Rd	2011-07-13 14:02:30 UTC (rev 1680)
+++ pkg/vegan/man/ordihull.Rd	2011-07-16 12:26:47 UTC (rev 1681)
@@ -1,8 +1,5 @@
 \name{ordihull}
 \alias{ordihull}
-\alias{ordiarrows}
-\alias{ordisegments}
-\alias{ordigrid}
 \alias{ordispider}
 \alias{ordiellipse}
 \alias{ordicluster}
@@ -13,15 +10,13 @@
 \alias{scores.ordihull}
 \alias{summary.ordiellipse}
 
-\title{Add Graphical Items to Ordination Diagrams}
-\description{
-  Functions to add convex hulls, arrows, line segments, regular grids of
-  points, `spider' graphs, ellipses or cluster dendrogram 
-  to ordination diagrams. The
-  ordination diagrams can be produced by \code{vegan}
-  \code{\link{plot.cca}}, \code{\link{plot.decorana}} or
-  \code{\link{ordiplot}}.
-}
+\title{Display Groups or Factor Levels in Ordination Diagrams}
+
+\description{ Functions to add convex hulls, `spider' graphs, ellipses
+  or cluster dendrogram to ordination diagrams. The ordination
+  diagrams can be produced by \code{vegan} \code{\link{plot.cca}},
+  \code{\link{plot.decorana}} or \code{\link{ordiplot}}.  }
+
 \usage{
 ordihull(ord, groups, display = "sites", draw = c("lines","polygon", "none"),
          show.groups, label = FALSE,  ...)
@@ -30,12 +25,6 @@
          col = NULL, show.groups, label = FALSE, ...)
 ordispider(ord, groups, display="sites", w = weights(ord, display),
          show.groups, label = FALSE, ...)
-ordiarrows(ord, groups, levels, replicates, display = "sites",
-         show.groups, startmark, label = FALSE, ...)
-ordisegments(ord, groups, levels, replicates, display = "sites",
-         show.groups, label = FALSE, ...)
-ordigrid(ord, levels, replicates, display = "sites",  lty = c(1,1), 
-         col = c(1,1), lwd = c(1,1), ...)
 ordicluster(ord, cluster, prune = 0, display = "sites",
          w = weights(ord, display), ...)
 }
@@ -44,59 +33,52 @@
   \item{ord}{An ordination object or an \code{\link{ordiplot}} object. }
   \item{groups}{Factor giving the groups for which the graphical item is
     drawn. }
-  \item{levels, replicates}{Alternatively, regular
-    groups can be defined with arguments \code{levels} and
-    \code{replicates}, where \code{levels} gives the number of groups,
-    and \code{replicates} the number of successive items at the same
-    group.}
   \item{display}{Item to displayed. }
-  \item{draw}{Use either \code{\link{lines}} or \code{\link{polygon}} to
-    draw the
-    line. Graphical parameters are passed to both. The main difference
-    is that \code{polygon}s may be filled and non-transparent. With \code{none}
-    nothing is drawn, but the function returns the \code{\link{invisible}}
-    plotting data.}
+
+  \item{draw}{Use either \code{\link{lines}} or \code{\link{polygon}}
+    to draw the lines. Graphical parameters are passed to both. The
+    main difference is that \code{polygon}s may be filled and
+    non-transparent. With \code{none} nothing is drawn, but the
+    function returns the \code{\link{invisible}} plotting data.}
+
   \item{show.groups}{Show only given groups. This can be a vector, or
     \code{TRUE} if you want to show items for which condition is
     \code{TRUE}. This argument makes it possible to use different
     colours and line types for groups. The default is to show all groups. }
-  \item{label}{Label the \code{groups} by their names. In
-    \code{ordiellipse}, \code{ordihull} and \code{ordispider} the the
-    group name is in the centroid of the object, in \code{ordiarrows}
-    in the start of the arrow, and in \code{ordisegments} at both
-    ends. \code{ordiellipse} and \code{ordihull} use standard
+
+  \item{label}{Label the \code{groups} by their names in the centroid
+    of the object. \code{ordiellipse} and \code{ordihull} use standard
     \code{\link{text}}, and others use \code{\link{ordilabel}}.}
-  \item{startmark}{plotting character used to mark the first
-    item. The default is to use no mark, and for instance, 
-    \code{startmark = 1} will draw a circle.  For other plotting characters,
-    see \code{pch} in \code{\link{points}}. }
+
   \item{w}{Weights used to find the average within group. Weights are
     used automatically for \code{\link{cca}}
     and \code{\link{decorana}} results, unless undone by the
     user. \code{w=NULL} sets equal weights to all points. }
+
   \item{kind}{Whether standard deviations of points (\code{sd}) or
     standard deviations of their (weighted) averages (\code{se}) are
     used.}
+
   \item{conf}{Confidence limit for ellipses, e.g. 0.95. If given, the
     corresponding \code{sd} or \code{se} is multiplied with the
     corresponding value found from the Chi-squared distribution with
     2df. }
+
   \item{cluster}{Result of hierarchic cluster analysis, such as
     \code{\link{hclust}} or \code{\link[cluster]{agnes}}.}
-  \item{col}{Colour of ellipses or ellipse fills in \code{ordiellipse}
-    or lines in \code{ordigrid}.  For other functions the effect depends
-    on the underlining functions this argument is passed to.}
-  \item{lty, lwd}{Line type, line width used for 
-    \code{level}s and \code{replicate}s in \code{ordigrid}.}
+
+  \item{col}{Colour of ellipses or ellipse fills in
+    \code{ordiellipse}. For other functions the effect depends on the
+    underlining functions this argument is passed to.}
+
   \item{prune}{Number of upper level hierarchies removed from the
     dendrogram. If \code{prune} \eqn{>0}, dendrogram will be
     disconnected.}
-   \item{\dots}{Parameters passed to graphical functions such
-    as \code{\link{lines}}, \code{\link{segments}},
-    \code{\link{arrows}}, \code{\link{polygon}} or to
-    \code{\link{scores}} to select axes and
-    scaling etc. }
-  }
+
+  \item{\dots}{Parameters passed to graphical functions or to
+    \code{\link{scores}} to select axes and scaling etc. } 
+}
+
 \details{
   Function \code{ordihull} draws \code{\link{lines}} or
   \code{\link{polygon}}s for the convex
@@ -123,45 +105,39 @@
   of the polygon. With \code{draw = "none"} only the result object is
   returned and nothing is drawn.
 
-  Function \code{ordiarrows} draws
-  \code{\link{arrows}} and \code{ordisegments} draws line
-  \code{\link{segments}} between successive items in the
-  groups. Function \code{ordigrid} draws line
-  \code{\link{segments}} both within the groups and for the
-  corresponding items among the groups.
-
   Function \code{ordispider} draws a `spider' diagram where each point
-  is connected to the group centroid with \code{\link{segments}}. 
-  Weighted centroids are used in the
-  correspondence analysis methods \code{\link{cca}} and
-  \code{\link{decorana}} or if the user gives the weights in the
-  call. If \code{ordispider} is called with \code{\link{cca}} or
-  \code{\link{rda}} result without \code{groups} argument, the function
-  connects each `WA' scores to the corresponding `LC' score. If the
-  argument is a (\code{invisible}) \code{ordihull} object, the functin
-  will connect the points of the hull to their centroid.
+  is connected to the group centroid with \code{\link{segments}}.
+  Weighted centroids are used in the correspondence analysis methods
+  \code{\link{cca}} and \code{\link{decorana}} or if the user gives
+  the weights in the call. If \code{ordispider} is called with
+  \code{\link{cca}} or \code{\link{rda}} result without \code{groups}
+  argument, the function connects each `WA' scores to the
+  corresponding `LC' score. If the argument is a (\code{invisible})
+  \code{ordihull} object, the functin will connect the points of the
+  hull to their centroid.
 
   Function \code{ordicluster} overlays a cluster dendrogram onto
   ordination. It needs the result from a hierarchic clustering such as
-  \code{\link{hclust}} or \code{\link[cluster]{agnes}}, or other
-  with a similar structure. Function \code{ordicluster} connects
-  cluster centroids to each other with line
-  \code{\link{segments}}. Function uses centroids of all points in the 
-  clusters, and is therefore similar to average linkage methods.
+  \code{\link{hclust}} or \code{\link[cluster]{agnes}}, or other with
+  a similar structure. Function \code{ordicluster} connects cluster
+  centroids to each other with line \code{\link{segments}}. Function
+  uses centroids of all points in the clusters, and is therefore
+  similar to average linkage methods.  
 }
 
-\note{These functions add graphical items to ordination graph: You must
-  draw a graph first.
-  }
+\note{These functions add graphical items to ordination graph: You
+  must draw a graph first. To draw line segments, grids or arrows, see
+  \code{\link{ordisegments}}, \code{\link{ordigrid}}
+  and\code{\link{ordiarrows}}.  }
+
 \author{ Jari Oksanen }
 
-\seealso{The functions pass parameters to basic graphical functions, and
-  you may wish to change the default values in \code{\link{arrows}},
+\seealso{The functions pass parameters to basic graphical functions,
+  and you may wish to change the default values in
   \code{\link{lines}}, \code{\link{segments}} and
-  \code{\link{polygon}}. You can pass
-  parameters to \code{\link{scores}} as well. Underlying function for
-  \code{ordihull} is \code{\link{chull}}.
-}
+  \code{\link{polygon}}. You can pass parameters to
+  \code{\link{scores}} as well. Underlying function for
+  \code{ordihull} is \code{\link{chull}}.  }
 
 \examples{
 data(dune)

Modified: pkg/vegan/tests/Examples/vegan-Ex.Rout.save
===================================================================
--- pkg/vegan/tests/Examples/vegan-Ex.Rout.save	2011-07-13 14:02:30 UTC (rev 1680)
+++ pkg/vegan/tests/Examples/vegan-Ex.Rout.save	2011-07-16 12:26:47 UTC (rev 1681)
@@ -4001,16 +4001,52 @@
 
 detaching ‘package:lattice’
 
+> nameEx("ordiarrows")
+> ### * ordiarrows
+> 
+> flush(stderr()); flush(stdout())
+> 
+> ### Name: ordiarrows
+> ### Title: Add Arrows and Line Segments to Ordination Diagrams
+> ### Aliases: ordiarrows ordisegments ordigrid
+> ### Keywords: aplot
+> 
+> ### ** Examples
+> 
+> example(pyrifos)
+
+pyrifs> data(pyrifos)
+
+pyrifs> ditch <- gl(12, 1, length=132)
+
+pyrifs> week <- gl(11, 12, labels=c(-4, -1, 0.1, 1, 2, 4, 8, 12, 15, 19, 24))
+
+pyrifs> dose <- factor(rep(c(0.1, 0, 0, 0.9, 0, 44, 6, 0.1, 44, 0.9, 0, 6), 11))
+> mod <- rda(pyrifos)
+> plot(mod, type = "n")
+> ## Annual succession by ditches
+> ordiarrows(mod, ditch, label = TRUE)
+> ## Show only control and highest Pyrifos treatment
+> plot(mod, type = "n")
+> ordiarrows(mod, ditch, label = TRUE, 
++    show.groups = c("2", "3", "5", "11"))
+> ordiarrows(mod, ditch, label = TRUE, show = c("6", "9"),
++    col = 2)
+> legend("topright", c("Control", "Pyrifos 44"), lty = 1, col = c(1,2))
+> 
+> 
+> 
+> cleanEx()
 > nameEx("ordihull")
 > ### * ordihull
 > 
 > flush(stderr()); flush(stdout())
 > 
 > ### Name: ordihull
-> ### Title: Add Graphical Items to Ordination Diagrams
-> ### Aliases: ordihull ordiarrows ordisegments ordigrid ordispider
-> ###   ordiellipse ordicluster weights.cca weights.rda weights.decorana
-> ###   summary.ordihull scores.ordihull summary.ordiellipse
+> ### Title: Display Groups or Factor Levels in Ordination Diagrams
+> ### Aliases: ordihull ordispider ordiellipse ordicluster weights.cca
+> ###   weights.rda weights.decorana summary.ordihull scores.ordihull
+> ###   summary.ordiellipse
 > ### Keywords: aplot
 > 
 > ### ** Examples
@@ -4613,7 +4649,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x102e8a118>
+<environment: 0x10425fa68>
 
 Estimated degrees of freedom:
 6.4351  total = 7.435071 
@@ -4629,7 +4665,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x1062d2808>
+<environment: 0x10611b910>
 
 Estimated degrees of freedom:
 6.0761  total = 7.076141 
@@ -4785,7 +4821,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x1071b84d8>
+<environment: 0x106481d18>
 
 Estimated degrees of freedom:
 8.9275  total = 9.927492 
@@ -4798,7 +4834,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x1068b80d8>
+<environment: 0x10702af78>
 
 Estimated degrees of freedom:
 7.7529  total = 8.75294 
@@ -4811,7 +4847,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x106b40630>
+<environment: 0x106697510>
 
 Estimated degrees of freedom:
 8.8962  total = 9.89616 
@@ -7004,7 +7040,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x1080e5a00>
+<environment: 0x107a91898>
 
 Estimated degrees of freedom:
 2  total = 3 
@@ -7469,7 +7505,7 @@
 > ### * <FOOTER>
 > ###
 > cat("Time elapsed: ", proc.time() - get("ptime", pos = 'CheckExEnv'),"\n")
-Time elapsed:  104.018 1.278 107.134 0 0 
+Time elapsed:  103.417 1.269 105.72 0 0 
 > grDevices::dev.off()
 null device 
           1 



More information about the Vegan-commits mailing list