pca_data {ztils} | R Documentation |
Principal Component Analysis Data
Description
This function uses a dataframe, PCA variables, and a scaled boolean to generate a dataframe with principal components as columns.
Usage
pca_data(data, pcavars, scaled = FALSE)
Arguments
data |
The dataframe to add principal components to. |
pcavars |
The variables to include in the principle component analysis |
scaled |
A boolean (TRUE or FALSE) indicating if the pcavars are already scaled |
Value
A plot showing PC1 on the x axis, PC2 on the y axis, colored by group, with vectors and labels showing the individual pca variables.
Examples
pca_data(iris, iris[,c(1:4)], FALSE)
[Package ztils version 1.0.0 Index]