Learn R Programming

analogue (version 0.10-0)

plot.prcurve: Plot a fitted principal curve in PCA space

Description

Projects the principal curve into PCA space and draws it and the underlying data in a biplot.

Usage

## S3 method for class 'prcurve':
plot(x, data, axes = 1:2, seg = TRUE, col.seg = "forestgreen",
     col.curve = "red", lwd.curve = 2, ...)

Arguments

x
an object of class "prcurve".
data
The data the principal curve was fitted to.
axes
numeric vector of length 2; this is passed to the choices argument of the scores function.
seg
logical; should segments be drawn between the observed points to the location on the principal curve on to which they project.
col.seg
The colour to draw the segments in.
col.curve
The colour to draw the principal curve in.
lwd.curve
The line thickness used to draw the principal curve.
...
additional arguments passed on to points when drawing the observations in PCA space.

Value

  • A plot on the currently active device. The function does not return anything.

See Also

prcurve; rda for the code used to perform the PCA.

Examples

Run this code
## 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.pc2 <- prcurve(abernethy2, method = "ca", trace = TRUE,
                    vary = TRUE, penalty = 1.4)

## Plot the curve
plot(aber.pc2, abernethy2)

Run the code above in your browser using DataLab