Description Usage Arguments Value Author(s) See Also Examples
Projects the principal curve into PCA space and draws it and the underlying data in a biplot.
1 2 3 4 5 6 7 8 9 |
x |
an object of class |
axes |
numeric vector of length 2; this is passed to the
|
scaling |
numeric; the scaling to use. See
|
segments |
logical; should segments be drawn between the observed points to the location on the principal curve on to which they project. |
col |
The colour to draw the principal curve in. |
col.seg |
The colour to draw the segments in. |
lwd, lwd.seg |
The line thickness used to draw the principal curve and segments respectively. |
... |
additional arguments passed on to |
A plot on the currently active device. The function does not return anything.
Gavin L. Simpson
prcurve
; rda
for the code used to perform
the PCA.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Load the Abernethy Forest data
data(abernethy)
## Remove the Depth and Age variables
abernethy2 <- abernethy[, -(37:38)]
## Fit the principal curve using varying complexity of smoothers
## for each species
aber.pc <- prcurve(abernethy2, method = "ca", trace = TRUE,
vary = TRUE, penalty = 1.4)
## Plot the curve
plot(aber.pc)
## The lines() method can be used to add the principal curve to an
## existing plot
ord <- rda(abernethy2)
plot(ord, scaling = 1)
lines(aber.pc, scaling = 1)
|
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.4-4
analogue version 0.17-0
Determining initial DFs for each variable...
|
| | 0%
|
|== | 3%
|
|==== | 6%
|
|====== | 8%
|
|======== | 11%
|
|========== | 14%
|
|============ | 17%
|
|============== | 19%
|
|================ | 22%
|
|================== | 25%
|
|=================== | 28%
|
|===================== | 31%
|
|======================= | 33%
|
|========================= | 36%
|
|=========================== | 39%
|
|============================= | 42%
|
|=============================== | 44%
|
|================================= | 47%
|
|=================================== | 50%
|
|===================================== | 53%
|
|======================================= | 56%
|
|========================================= | 58%
|
|=========================================== | 61%
|
|============================================= | 64%
|
|=============================================== | 67%
|
|================================================= | 69%
|
|=================================================== | 72%
|
|==================================================== | 75%
|
|====================================================== | 78%
|
|======================================================== | 81%
|
|========================================================== | 83%
|
|============================================================ | 86%
|
|============================================================== | 89%
|
|================================================================ | 92%
|
|================================================================== | 94%
|
|==================================================================== | 97%
|
|======================================================================| 100%
Fitting Principal Curve:
Initial curve: d.sq: 103233.450
Iteration 1: d.sq: 4283.431
Iteration 2: d.sq: 4312.298
Iteration 3: d.sq: 4340.691
Iteration 4: d.sq: 4355.388
Iteration 5: d.sq: 4366.497
Iteration 6: d.sq: 4369.944
PC Converged in 6 iterations.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.