Learn R Programming

vegan3d (version 0.65-1)

ordirgl: Three-Dimensional Dynamic Ordination Graphics

Description

Function ordirgl displays three-dimensional dynamic ordination graphs which can be rotated and zoomed into using rgl package. Function workw with all ordination results form vegan and all ordination results known by scores function.

Usage

ordirgl(object, display = "sites", choices = 1:3, type = "p", 
        ax.col = "red", arr.col = "yellow", text, envfit, ...)
orglpoints(object, display = "sites", choices = 1:3, ...)
orgltext(object, text, display = "sites", choices = 1:3, justify = "center", 
        adj = 0.5, ...)
orglsegments(object, groups, display = "sites", choices = 1:3, ...)
orglspider(object, groups, display = "sites", w = weights(object, display),
        choices = 1:3, ...)

Arguments

object
An ordination result or any object known by scores.
display
Display "sites" or "species" or other ordination object recognized by scores.
choices
Selected three axes.
type
The type of plots: "p" for points or "t" for text labels.
ax.col
Axis colour (concerns only the crossed axes through the origin).
arr.col
Colour of biplot arrows and centroids of environmental variables.
text
Text to override the default with type = "t".
envfit
Fitted environmental variables from envfit displayed in the graph.
justify, adj
Text justification passed to rgl.texts. One of these is used depending on the version of rgl installed.
groups
Factor giving the groups for which the graphical item is drawn.
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<
...
Other parameters passed to graphical functions.

Value

  • Function ordirgl returns nothing.

Warning

Function ordirgl uses OpenGL package rgl which may not be functional in all platforms, and can crash R in some: use save.image before trying ordirgl. Mac users must start X11 (and first install X11 and some other libraries) before being able to use rgl. It seems that rgl.texts does not always position the text like supposed, and it may be safe to verify text location with corresponding points.

Details

Function ordirgl plots dynamic graphics using OpenGL with rgl. Function uses most default settings of underlying graphical functions, and you must consult their help pages to change graphics to suit your taste (rgl, rgl.points,rgl.texts). Functions will display only one selected set of scores, typically either "sites" or "species", but for instance cca also has "lc" scores. In constrained ordination (cca, rda, capscale), biplot arrows and centroids are always displayed similarly as in two-dimensional plotting function plot.cca. Alternatively, it is possible to display fitted environmental vectors or class centroids from envfit in both graphs. These are displayed similarly as the results of constrained ordination, and they can be shown only for non-constrained ordination. The user must remember to specify at least three axes in envfit if the results are used with these functions.

Function ordigl makes a dynamic three-dimensional graph that can be rotated with mouse, and zoomed into with mouse buttons or wheel (but Mac users with one-button mouse should see rgl.viewpoint, or try ctrl-button). MacOS X users must start X11 before calling rgl commands. Function ordirgl uses default settings, and you should consult the underlying functions rgl.points, rgl.texts to see how to control the graphics. Function ordirgl always cleans its graphic window before drawing. Functions orglpoints adds points and orgltext adds text to existing ordirgl windows. In addition, function orglsegments combines points within "groups" with line segments similarly as ordisegments. Function orglspider works similarly as ordispider: it connects points to their weighted centroid within "groups", and in constrained ordination it can connect "wa" or weighted averages scores to corresponding "lc" or linear combination scores if "groups" is missing. In addition, basic rgl functions rgl.points, rgl.texts, rgl.lines and many others can be used.

See Also

rgl, rgl.points, rgl.texts, rgl.viewpoint, envfit.

Examples

Run this code
## Examples are not run, because they need user interaction.
ordirgl(ord, size=2)
ordirgl(ord, display = "species", type = "t")
rgl.quit()

Run the code above in your browser using DataLab