在 factoextra 对象上使用 ggplotly
using ggplotly on a factoextra object
考虑以下代码:
library(FactoMineR)
library(dplyr)
library(factoextra)
library(plotly)
pca1<-PCA(iris[,1:4])
fpi<-fviz_pca_ind(pca1,habillage = iris$Species)
fpi
现在当执行下面的代码时,组会重复两次,如图所示。如何解决?
ggplotly(fpi)
只需使用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)
考虑以下代码:
library(FactoMineR)
library(dplyr)
library(factoextra)
library(plotly)
pca1<-PCA(iris[,1:4])
fpi<-fviz_pca_ind(pca1,habillage = iris$Species)
fpi
现在当执行下面的代码时,组会重复两次,如图所示。如何解决?
ggplotly(fpi)
只需使用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)