Package 'analogueExtra'

Title: Additional Functions for Use with the 'analogue' Package
Description: Provides additional functionality for the analogue package that is not required by all users of the main package.
Authors: Gavin L. Simpson [aut, cre]
Maintainer: Gavin L. Simpson <[email protected]>
License: GPL-2
Version: 0.1-2
Built: 2024-11-17 06:12:26 UTC
Source: https://github.com/gavinsimpson/analogueExtra

Help Index


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

## S3 method for class 'prcurve'
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.

Author(s)

Gavin L. Simpson

See Also

ordirgl, prcurve.

Examples

## 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)
}