PLOT.PCA: Plot the results of a principal component analysis

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/PLOT.PCA.r

Description

Various maps and biplots of the results of a principal component analysis using function PCA.

Usage

1
2
3
PLOT.PCA(obj, map="symmetric", rescale=1, dim=c(1,2), axes.inv = c(1,1),
         main="", cols=c("blue","red"), colarrows = "pink", cexs=c(0.8,0.8),
         fonts=c(2,4))

Arguments

obj

An LRA object created using function LRA

map

Choice of scaling of rows and columns: "symmetric" (default), "asymmetric" or "contribution"

rescale

A rescaling factor applied to column coordinates (default is 1 for no rescaling)

dim

Dimensions selected for horizontal and vertical axes of the plot (default is c(1,2))

axes.inv

Option for reversing directions of horizontal and vertical axes (default is c(1,1) for no reversing, change one or both to -1 for reversing)

main

Title for plot

cols

Colours for row and column labels (default is c("blue","red"))

colarrows

Colour for arrows in asymmetric and contribution biplots (default is "pink")

cexs

Character expansion factors for row and column labels (default is c(0.8,0.8))

fonts

Fonts for row and column labels (default is c(2,4))

Details

The function PLOT.PCA makes a scatterplot of the results of a logratio analysis (computed using function PCA), with various options for scaling the results and changing the direction of the axes. By default, dimensions 1 and 2 are plotted on the horizontal and vertical axes, and it is assumed that row points refer to samples and columns to variables.

By default, the symmetric scaling is used, where both rows and columns are in principal coordinates and have the same amount of weighted variance along the two dimensions. The other options are biplots: the asymmetric option, when columns are in standard coordinates, and the contribution option, when columns are in contribution coordinates. In cases where the row and column displays occupy widely different extents, the column coordinates can be rescaled using the rescale option.

Author(s)

Michael Greenacre

References

Greenacre, M. (2013), Contribution biplots, Journal of Computational and Graphical Statistics, 22, 107-122.

See Also

plot.ca

Examples

1
2
3
4
5
6
# perform weighted PCA on the ALRs of the RomanCups data set
# where the first oxide silica is chosen as the denominator
data(cups)
cups.ALR <- ALR(cups, denom=1)
cups.PCA <- PCA(cups.ALR)
PLOT.PCA(cups.PCA, map="contribution", rescale=0.2, axes.inv=c(1,-1))	

Example output

Loading required package: ca
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-7
Loading required package: ellipse

Attaching package:ellipseThe following object is masked frompackage:graphics:

    pairs

easyCODA documentation built on Sept. 20, 2020, 1:07 a.m.