Rank-2 PCA biplots are constructed based on a combination of the first three principal components.
PCAbiplot(
x,
group = NULL,
scale = TRUE,
basis = 1:2,
symbol = "circle",
color = NULL,
build_plot = TRUE
)A named list of class bipl5 with the following attributes
A data frame which is the original input data
A matrix of n x 2 representing the coordinates of each observation on the biplot
The rank of the approximated data
Whether the data is standardized prior to performing dimension reduction
The grouping vector of the data
The vector of column means of the input data
Vector of column standard deviations if the scale parameter is set to TRUE.
The singular value decomposition of the covariance/correlation matrix, see svd
The plotly graph displaying the biplot, see plot_ly
The adequacy of each axis displayed for each set of principal components
The predictivity of each axis displayed for each set of principal components
A numeric matrix or data frame of size n x p
Vector of size n representing the class of each observation in x
Boolean: indicating whether the data matrix should be standardized before SVD is performed. Similar to the cor argument in princomp
A vector specifying which eigenvectors serve as basis for the plot. Currently only a biplot of rank 2 is supported
Plotting symbol to be used per class group
Colors to be utilized per class group
Boolean, indicating whether the biplot should be drawn or not. Mostly used in internal function calls serve as basis for the biplot. Currently only a biplot of rank 2 is supported
The method performs Principal Component Analysis (PCA) on the input data and constructs both a traditional
biplot using vector representation and with calibrated axes. The data is clustered together on the display by the
group parameter. The scale parameter determines if SVD is performed on the covariance matrix
or correlation of x. It is highly recommended to set scale=TRUE as the rendered display
is sensitive to the scaling in x.
By default three sets of principal components are used for the scaffolding axes, namely: 1 and 2, 1 and 3, and 2 and 3.
The function constructs these biplots in the plot_ly graphing library with reactivity
embedded on the display. The following features are available on the display:
A dropdown menu to change the principal components used to construct the display. Currently only the first three pairwise are supported.
A button to give fit statistics of the biplot. Once clicked, a table is added to give the adequacy and predictivity of each axis for the display.
A button that inserts a graph depicting the cumulative predictivity of each axis against the dimension of the biplot. See FMbiplot for the coordinates.
A button that changes the display from vector representation of the variables, to calibrated axes in their original scale. The vector representation includes a unit circle around the origin.
Prediction lines are inserted onto the display if an observation is clicked. The prediction lines can be removed by clicking on the legend entry.
print.bipl5 to display the biplot graph and
further see TDAbiplot to
draw a biplot with calibrated density axes. Fit measures can be obtained by FMbiplot
## Consruct a biplot with
x<-PCAbiplot(iris[,1:4],group=iris[,5])
#alternatively
print(x)
## Construct a biplot that preserves the correlation structure among the variables
y<-PCAbiplot(iris[,-5],group=iris[,5],scale=TRUE)
Run the code above in your browser using DataLab