biplot: Biplot

View source: R/biplot.R

biplotR Documentation

Biplot

Description

Produces a 2- or 3-dimensional biplot of the data according to the orthogonal projection matrix supplied.

Usage

biplot(datalist, B, D3 = FALSE, varex = 1, plotvar = TRUE, main = "CPC biplot", col = c("blue", "red", "green", "orange", "brown", "purple"), radius = 0.1, lwd = 3)

Arguments

datalist

List of the data from the k groups.

B

Orthogonal projection matrix.

D3

Logical, indicating whteher a 3-dimensional biplot should be produced (default = FALSE).

varex

Expansion factor for drawing the variables on the biplot.

plotvar

Logical, indicating whether the variables should be drawn on the biplot (default = TRUE).

main

Title of the biplot, to be passed to plot.

col

Colors for the data points of the k groups.

radius

Radius of the spheres in the case of a 3D biplot being drawn, to be passed to spheres3d.

lwd

Line width of the variable vectors in the case of a 3D biplot being drawn, to be passed to lines3d.

Details

This function may be used to produce a biplot in Euclidean space using any orthogonal projection matrix B. The obvious choice for B is the eigenvectors of the pooled data, producing the usual PCA biplot. Other choices for B includes the common eigenvector matrices estimated with the FG algorithm or stepwise CPC.

Value

Produces a biplot in a graphics device window.

Author(s)

Theo Pepler

References

Pepler, P.T. (2014). The identification and application of common principal components. PhD dissertation in the Department of Statistics and Actuarial Science, Stellenbosch University.

See Also

biplot.measures, biplot.choice

Examples

# The Iris data
data(iris)
setosa <- iris[1:50, 1:4]
versicolor <- iris[51:100, 1:4]
virginica <- iris[101:150, 1:4]
project.matrix <- eigen(cov(rbind(setosa, versicolor, virginica)))$vectors

# For a 2-dimensional biplot
cpc::biplot(datalist = list(setosa, versicolor, virginica), B = project.matrix, varex = 3, main = "CPC biplot: Iris data")

# For a 3-dimensional biplot
cpc::biplot(datalist = list(setosa, versicolor, virginica), B = project.matrix, D3 = TRUE, main = "CPC biplot: Iris data")

tpepler/cpc documentation built on July 7, 2022, 2:13 a.m.