User Tools

Site Tools


en:ordiagrams_r

This is an old revision of the document!


Ordination analysis

Ordination diagrams

R functions

From library vegan:

  • scores - function extracting site or species scores from the ordination object. All functions drawing ordination diagrams are using scores extracted by this function. Note that the way how scaling is implemented in vegan package was recently reworked - read the blog post of Gavin Simpson for more details. FIXME
  • ordiplot - high-level plotting function, draws complete ordination diagrams (plot applied on result of ordination does the same).
  • biplot - high-level plotting function suitable only for unconstrained linear ordination methods (PCA and tb-PCA); draws species as arrows indicating increasing abundance of given species. If used with unimodal methods (like CA) or constrained ordination (RDA, CCA), an error is returned.
  • orditorp - adds labels onto existing ordination diagram, so as they are readable (they don't overlap). Has arguments priority (which species/sites will be given priority to draw the text instead of only point) and select (logical vector - which species/sites should be drawn).
  • ordilabel - adds the labels which look like stickers; also has priority and select arguments (see orditorp function above).
  • points - adds points to the ordination diagram (low-level plotting function, adds points to ordination diagram created by ordiplot or plot). Has argument select - logical vector indicating which elements should be displayed (the same for text below).
  • text - similar to points above, adds the text labels for sites/species.
  • ordipointlabel - creates new ordination diagram and adds both points and labels (for species or sites) in a way to minimize their overlap (uses iteratively optimizing algorithm and can be rather slow). Can be stored in an object further editable interactively by the function orditkplot.
  • orditkplot - produces editable and clickable ordination diagrams, which can be exported, saved into R and also reedited again. Check blogpost of Gavin Simpson to see how to use it.
  • ordispider - creates spiderplot by connecting individual members of the group with the group centroid.
  • ordihull - draws envelope (convexhull) around the group of samples (possibly also color-filled polygon).
  • ordiellipse - similar to envelopes - clouds of points within the group are encircled by ellipse.
  • ordiarrows - draws arrows connecting the groups of samples (visualizing e.g. development of composition in time or in space).

From library vegan3d1):

  • ordirgl - draws 3D ordination diagram, using functionality of library (rgl).
  • orglspider - adds spiders to 3D ordination diagram created by ordirgl.

Custom functions:

  • ordicenter - adds labels to centroids of groups onto ordination diagrams. Similar to ordispider with argument label = TRUE, but does not draw spider plot. Arguments and use are analogous to ordispider and ordihull. Definition here.
  • orglhull - adds 3D convexhulls wrapping groups of samples (possibly transparent). Custom function not in vegan or vegan3d, requires library (geometry). Definition here.
1)
Note that functions for drawing 3D ordination diagrams have been moved from vegan to a new package vegan3d - the reason according to this message from Jari Oksanen is that these function caused troubles with running or even installing vegan on some platforms, so to separate them was good for stability of vegan.
en/ordiagrams_r.1548503299.txt.gz · Last modified: 2019/01/26 19:48 by David Zelený