...
res.pca <- prcomp(env.active, center = TRUE,scale. = TRUE)
summary(res.pca)
res.pca <- prcomp(env.active, scale = TRUE)
fviz_eig(res.pca)
fviz_pca_var(res.pca,
col.var = "contrib", # Color by contributions to the PC
gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
repel = TRUE # Avoid text overlapping
)
groups <- as.factor(env_table$Month)
fviz_pca_ind(res.pca,
col.ind = groups, # color by groups
palette = c("#009999", "#0000ff", "#FF3399", "#33FF33","#FF3333", "#FF0000","#CC66FF", "#330000", "#33FF00"),
addEllipses = FALSE, # Concentration ellipses
ellipse.type = "confidence",
legend.title = "Groups",
repel = TRUE
)
I used the code above for PCA, I cant figure out why the PCA biplot is like this?