plot.pda: Plotting and summary of pda object

View source: R/pda.R

plot.pdaR Documentation

Plotting and summary of pda object

Description

Generic functions for plotting and printing the content of a pda object.

Usage

## 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, ...)

Arguments

x

A pda object, see below.

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 pda object, see below.

Details

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.

Author(s)

Lars Snipen.

See Also

pda.

Examples

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)


larssnip/mpda documentation built on March 28, 2022, 3:37 p.m.