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 |
Draws a 3D plot of the principal curve in principal coordinate space using the rgl package and functions from vegan3d.
## 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, ...)
## 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, ...)
x |
an object of class |
choices |
numeric vector of length 3; the ordination axes to plot. |
display |
character; which scores to display. See |
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 |
A plot is drawn on the active RGL device. If there is no active RGL device, one is opened upon plotting.
Gavin L. Simpson
## 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) }
## 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) }