Learn R Programming

analogueExtra (version 0.1-1)

plot3d.prcurve: Interactive 3D plot of a principal curve in principal coordinate space

Description

Draws a 3D plot of the principal curve in principal coordinate space using the rgl package and functions from vegan3d.

Usage

"plot3d"(x, choices = 1:3, display = "sites", scaling = 0, lcol = "darkorange", lwd = 2, decorate = TRUE, xlab = NULL, ylab = NULL, zlab = NULL, main = NULL, ...)

Arguments

x
an object of class "prcurve" resulting from a call to prcurve.
choices
numeric vector of length 3; the ordination axes to plot.
display
character; which scores to display. See scores.rda.
scaling
numeric; the scaling to use for the scores. Default is no scaling.
lcol, lwd
The colour and width, respectively, for the principal curve.
decorate
logical; should the plot be decorated with bounding box, axes and labels?
xlab, ylab, zlab, main
Labels for the plot.
...
Arguments passed to other functions. In particular, argments are passed to ordirgl, lines3d, and decorate3d.

Value

A plot is drawn on the active RGL device. If there is no active RGL device, one is opened upon plotting.

See Also

ordirgl, prcurve.

Examples

Run this code
## Only works if the analogue package is available
if (require("analogue")) {
    ## Load the Abernethy Forest late glacial pollen sequence
    data(abernethy)

    ## Remove the Depth and Age variables
    abernethy2 <- abernethy[, -(37:38)]

    ## Fit the principal curve using the median complexity over
    ## all species
    aber.pc <- prcurve(abernethy2, method = "ca", trace = TRUE,
                       vary = FALSE, penalty = 1.4)

    ## 3D plot of data with curve superimposed
    ## plot3d.prcurve(aber.pc) # now deprecated, instead use
    plot3d(aber.pc)
}

Run the code above in your browser using DataLab