R Perform principal component analysis using the prcomp function on the scaled numeric predictors code example
Example: principal component analysis in r
library(FactoMineR)
library(factoextra)
res.pca = FactoMineR::PCA(X, scale.unit = TRUE, ncp = 5, graph = TRUE)
factoextra::fviz_eig(res.pca, addlabels = TRUE, ylim = c(0, 50))