Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

orditree3d

Draw Cluster Tree over a Plane


Description

Function draws a 3D plot where ordination result is at the bottom plane and a hclust dendrogram is drawn above the plane.

Usage

orditree3d(ord, cluster, prune = 0, display = "sites", choices = c(1, 2),
    col = "blue", text, type = "p", ...)
ordirgltree(ord, cluster, prune = 0, display = "sites", choices = c(1, 2),
    col = "blue", text, type = "p", ...)

Arguments

ord

An ordination object or an ordiplot object or any other structure defining a 2D plane.

cluster

Result of hierarchic cluster analysis, such as hclust or agnes or any other clutering that can be coerced to a compliant format by as.hclust.

prune

Number of upper levels hierarchies removed from the tree. If prune > 0, tree will be cut into prune + 1 disconnected trees.

choices

Choice of ordination axes.

display

Ordination scores displayed.

col

Colour of tree. The colour can be a vector and it is used for the points, text and terminal branches. The colour of internal branches is a mixture of connected leaves.

text

Text to replace the default of item labels when type = "t".

type

Display of leaves: "p" for points, "t" for text, and "n" for no display.

...

Arguments passed to scores and graphical functions.

Details

orditree3d uses scatterplot3d package to draw a static 3D plot of the dendrogram over the ordination, and ordirgltree uses rgl to make a dynamic, spinnable plot. The functions were developed to plot a cluster dendrogram over a 2D ordination plane, but any other plane can be used, for instance, a map.

Value

Function orditree3d returns invisibly a scatterplot3d result object amended with items points and internal that give the projected coordinates of ordination scores and internal nodes, and col.points and col.internal that give their colours. All matrix-like objects can be accessed with scores.

Function ordirgltree returns nothing.

Author(s)

Jari Oksanen.

See Also

Examples

data(dune, dune.env)
  d <- vegdist(dune)
  m <- metaMDS(d)
  cl <- hclust(d, "aver")
  orditree3d(m, cl, pch=16, col=cutree(cl, 3))
  ## ordirgltree makes ordinary rgl graphics. It accepts
  ## rgl.material() settings, and you can add elements to the
  ## open graph (for instance, bbox3d()).
  if (interactive() && require(rgl, quietly = TRUE)) {
  with(dune.env, ordirgltree(m, cl, col = as.numeric(Management), size = 6,
     lwd = 2, alpha = 0.6))
  }

vegan3d

Static and Dynamic 3D Plots for the 'vegan' Package

v1.1-2
GPL-2
Authors
Jari Oksanen [aut, cre], Roeland Kindt [aut], Gavin L. Simpson [aut]
Initial release
2018-10-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.