pacman::p_load(ade4,FactoMineR, factoextra,DT)
setwd("D:/R/for_van_tran/")
df <- read.csv("D:/R/for_van_tran/thong-ke2.csv", row.names = 1)
datatable(df, class = "compact")
res <- dudi.pca(df,scannf = F)
fviz_pca_ind(res,col.ind = "blue", alpha.ind = 0.5)
## Warning in set.seed(123): '.Random.seed' is not an integer vector but of
## type 'NULL', so ignored
fviz_pca_var(res, col.var = "red", alpha.var = 0.5)
fviz_pca_biplot(res, col.ind = "blue", col.var="red", alpha=0.5)
Hoặc
library(gridExtra)
g1 <- fviz_pca_ind(res,col.ind = "blue", alpha.ind = 0.5)
g2 <- fviz_pca_var(res, col.var = "red", alpha.var = 0.5)
grid.arrange(g1,g2, ncol=2)