plot.pda | R Documentation |
Generic functions for plotting and printing the content of a pda
object.
## S3 method for class 'pda' plot( x, y = NULL, col = c("tan3", "slategray3"), pch = c(15, 15), legend.pos = "topright", xlab = "PLS dimension 1", ylab = "PLS dimension 2", ... ) ## S3 method for class 'pda' summary(object, ...)
x |
A |
y |
not used. |
col |
Two colors, one for each class-label. |
pch |
Two markers, one for each class-label. |
legend.pos |
Position of legend. |
xlab |
Text on x-axis. |
ylab |
Text on y-axis. |
... |
Optional graphical arguments. |
object |
A |
A pda
object contains a fitted pda
model.
The plot.pda
function display the samples as markers in the first 2 dimensions of the PLS-score space, and color
the markers by the class label information. If the PLS-score-space has only 1 dimension, the second axis in the plot
is non-informative. Since a pda
object always has only 2 classes, you always specify a pair of colors
and markers in col
and pch
. The legend.pos
must be one of the texts "bottomright", "bottom",
"bottomleft", "left", "topleft", "top", "topright", "right" and "center", specifying the position of the legend
inside the plot.
The summary.pda
function will display a text giving the number of samples from each class,
the number of PLS-dimensions used, and the priors used in the model fitting.
Lars Snipen.
pda
.
data(microbiome) y <- microbiome[1:40,1] X <- as.matrix(microbiome[1:40,-1]) p.trn <- pda(y,X,prior=c(0.5,0.5),max.dim=2) plot(p.trn) summary(p.trn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.