pcabiplot {kmed} | R Documentation |
Biplot of a PCA object
Description
This function creates a biplot from a pca object, which is
generated by the prcomp
function from the stats package.
Usage
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 |
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
pcadat <- prcomp(iris[,1:4], scale. = TRUE)
pcabiplot(pcadat)