ordihull {vegan}R Documentation

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 vegan plot.cca, plot.decorana or ordiplot.

Usage

ordihull(ord, groups, display = "sites", draw = c("lines","polygon", "none"),
         show.groups, label = FALSE,  ...)
ordiellipse(ord, groups, display="sites", kind = c("sd","se"), conf,
         draw = c("lines","polygon", "none"), w = weights(ord, display),
         show.groups, label = FALSE, ...)
ordispider(ord, groups, display="sites", w = weights(ord, display),
         show.groups, ...)
ordiarrows(ord, groups, levels, replicates, display = "sites",
         show.groups, startmark, ...)
ordisegments(ord, groups, levels, replicates, display = "sites",
         show.groups, ...)
ordigrid(ord, levels, replicates, display = "sites",  ...)
ordicluster(ord, cluster, prune = 0, display = "sites",
         w = weights(ord, display), ...)

Arguments

ord An ordination object or an ordiplot object.
groups Factor giving the groups for which the graphical item is drawn.
levels, replicates Alternatively, regular groups can be defined with arguments levels and replicates, where levels gives the number of groups, and replicates the number of successive items at the same group.
display Item to displayed.
draw Use either lines or polygon to draw the line. Graphical parameters are passed to both. The main difference is that polygons may be filled and non-transparent. With none nothing is drawn, but the function returns the invisible plotting data.
show.groups Show only given groups. This can be a vector, or TRUE if you want to show items for which condition is TRUE. This argument makes it possible to use different colours and line types for groups. The default is to show all groups.
label Label the centre of the points in hull or the ellipse with the group name.
startmark plotting character used to mark the first item. The default is to use no mark, and for instance, startmark = 1 will draw a circle. For other plotting characters, see pch in points.
w Weights used to find the average within group. Weights are used automatically for cca and decorana results, unless undone by the user. w=NULL sets equal weights to all points.
kind Whether standard deviations of points (sd) or standard deviations of their (weighted) averages (se) are used.
conf Confidence limit for ellipses, e.g. 0.95. If given, the corresponding sd or se is multiplied with the corresponding value found from the Chi-squared distribution with 2df.
cluster Result of hierarchic cluster analysis, such as hclust or agnes.
prune Number of upper level hierarchies removed from the dendrogram. If prune >0, dendrogram will be disconnected.
... Parameters passed to graphical functions such as lines, segments, arrows, polygon or to scores to select axes and scaling etc.

Details

Function ordihull draws lines or polygons for the convex hulls found by function chull encircling the items in the groups.

Function ordiellipse draws lines or polygons for dispersion ellipse using either standard deviation of point scores or standard error of the (weighted) average of scores, and the (weighted) correlation defines the direction of the principal axis of the ellipse. An ellipsoid hull can be drawn with function ellipsoidhull of package cluster.

Functions ordihull and ordiellipse return the invisible plotting structure. In ordihull this is a list of coordinates of the hull and in ordiellipse a list of covariance matrices and scales used in drawing the ellipses. These result objects have a summary method that returns the coordinates of the centres of the ellipses or hulls and their surface areas in user units. The centres of the hulls may differ from the location of the label which is the centre of the points instead of the centre of the polygon. With draw = "none" only the result object is returned and nothing is drawn.

Function ordiarrows draws arrows and ordisegments draws line segments between successive items in the groups. Function ordigrid draws line segments both within the groups and for the corresponding items among the groups.

Function ordispider draws a `spider' diagram where each point is connected to the group centroid with segments. Weighted centroids are used in the correspondence analysis methods cca and decorana or if the user gives the weights in the call. If ordispider is called with cca or rda result without groups argument, the function connects each `WA' scores to the corresponding `LC' score.

Function ordicluster overlays a cluster dendrogram onto ordination. It needs the result from a hierarchic clustering such as hclust or agnes, or other with a similar structure. Function ordicluster connects cluster centroids to each other with line 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.

Author(s)

Jari Oksanen

See Also

The functions pass parameters to basic graphical functions, and you may wish to change the default values in arrows, lines, segments and polygon. You can pass parameters to scores as well. Underlying function for ordihull is chull.

Examples

data(dune)
data(dune.env)
mod <- cca(dune ~ Management, dune.env)
attach(dune.env)
## pass non-graphical arguments without warnings
plot(mod, type="n", scaling = 3)
## Catch the invisible result of ordihull...
pl <- ordihull(mod, Management, scaling = 3, label = TRUE)
## ... and find centres and areas of the hulls
summary(pl)
ordispider(mod, col="red", scaling = 3)
plot(mod, type = "p", display="sites")
ordicluster(mod, hclust(vegdist(dune)), prune=3, col = "blue")
plot(mod, type="n", display = "sites")
text(mod, display="sites", labels = as.character(Management))
pl <- ordiellipse(mod, Management, kind="se", conf=0.95, lwd=2, col="blue")
summary(pl)

[Package vegan version 1.16-32 Index]