How to do it...

Identifying the most important variables in data with PCA can be done using the following steps:

  1. Perform PCA:
library(factoextra)
pca_result <- prcomp(iris[,-5], scale=TRUE, center=TRUE )
  1. Create a variable plot:
fviz_pca_var(pca_result, col.var="cos2")
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.25.67