pca_data | R Documentation |
This function uses a dataframe, PCA variables, and a scaled boolean to generate a dataframe with principal components as columns.
pca_data(data, pcavars, scaled = FALSE)
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 |
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.
pca_data(iris, iris[,c(1:4)], FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.