pcabiplot: Biplot of a PCA object

Description Usage Arguments Details Value Author(s) Examples

Description

This function creates a biplot from a pca object, which is generated by the prcomp function from the stats package.

Usage

1
2
pcabiplot(PC, x = "PC1", y = "PC2", var.line = TRUE, colobj = rep(1,
  nrow(PC$x)), o.size = 1)

Arguments

PC

A pca object generated by prcomp function.

x

X axis (see Details).

y

Y axis (see Details).

var.line

A logical input, if variable lines are plotted.

colobj

A vector to provide color in the objects (see Details).

o.size

A numeric number to set the object size.

Details

This is a function to plot a pca biplot from a pca object. The x and y axes can be supplied with any principle component. The length of the colobj vector has to be equal to the number of objects. This argument controls the color of the objects and is very convenient to explore the clustering result. The default value is that all object have the same color.

Value

Function returns a plot of pca.

Author(s)

Weksi Budiaji
Contact: budiaji@untirta.ac.id

Examples

1
2
pcadat <- prcomp(iris[,1:4], scale. = TRUE)
pcabiplot(pcadat)

kmed documentation built on Jan. 8, 2021, 2:40 a.m.