Consider following code:
library(FactoMineR)
library(dplyr)
library(factoextra)
library(plotly)
pca1<-PCA(iris[,1:4])
fpi<-fviz_pca_ind(pca1,habillage = iris$Species)
fpi
Now when execute following code, the groups repeat twice as shown in picture. How to solve this?
ggplotly(fpi)
Just use label = "var"
library(FactoMineR)
library(dplyr)
library(factoextra)
library(plotly)
pca1<-PCA(iris[,1:4])
#Here use label = "var"
fpi<-fviz_pca_ind(pca1,habillage = iris$Species, label = "var")
fpi
ggplotly(fpi)