Questions tagged [factoextra]

factoextra is an R package making easy to extract and visualize the output of exploratory multivariate data analyses, including PCA , CA, MCA, MFA, HMFA and FAMD

factoextra is a R package, written by Alboukadel Kassambara, is an R package for visualizing the output of exploratory multivariate data analyses. It extracts analysis results from various R packages for principal component analysis and can generate ggplot2-based plots. Also it contains functions facilitating clustering analysis and visualization.

Repositories

books

70 questions
2
votes
1 answer

Clustering plot. Add the cluster number: Function fviz_cluster (factoextra)

I have the following R code: library(factoextra) kms<-kmeans(df,18,nstart=100) fviz_cluster(kms, data = df, alpha=0.2,shape=19,geom = "point") It outputs the following picture: Is possible to add the number of the clusters inside the respective…
Lev
  • 693
  • 1
  • 8
  • 24
2
votes
1 answer

color branches of dendrogram by groups in R (without h or k element)

I want to color branches of a dendrogram by specific groups that a defined in a dataframe. library(reshape2) library(factoextra) # clustering visualization library(dendextend) #iris dataset #defining colors colori = rep(NA,…
takeITeasy
  • 350
  • 3
  • 19
2
votes
2 answers

FactoMineR/factoextra visualize all the clusters in the dendrogram

I performed a hierarchical clustering on a dataframe using the HCPC function of the package FactoMineR. Problem is, I cannot visualize the number of clusters I asked when I draw the dendrogram using factoextra. Here is below a reproducible example…
ePoQ
  • 434
  • 3
  • 18
2
votes
1 answer

How to obtain the matrix from the ordered dissimilarity image generated in fviz_dist?

I'm trying to obtain the matrix (Ordered dissimilarity matrix) from the ggplot that is generated with the function fviz_dist from factoextra package. From my original data I generated a distance correlation matrix using dis.cor (I need to use…
Amanda
  • 21
  • 1
2
votes
1 answer

PCA change colours of clusters

I want to change the colours of my clusters but maintain the shape. habillage=iris$Species changes both colour and shape, what can to change only colours? library("devtools") install_github("kassambara/factoextra") library("factoextra") res.pca <-…
Al14
  • 1,734
  • 6
  • 32
  • 55
2
votes
0 answers

Ellipses for selected individuals - Factoextra plots

In order to show specific features from the results of my PCA (with FactomineR), I am trying to manipulate the plot of individuals and the biplot with the factoextra package. I want to draw ellipses around my individuals, but they belong to 10…
2
votes
0 answers

The value of reference line in PCA contributions in Factoextra package

Factoextra is an excellent package to visualize the PCA result. And what I want to know is the value of the reference line in the PCA contributions plot. In this case it is about 10%. Is there a general principle what is this…
Minyi Han
  • 807
  • 1
  • 8
  • 15
2
votes
1 answer

factoextra package: How can I plot my clusters using variable axes and not PCA component axes?

library(cluster) km.res <- kmeans(my_data, 4, nstart = 25) # Visualize library("factoextra") fviz_cluster(km.res, data = my_data, frame.type = "convex")+ theme_minimal() I would like to change the axes to other variables. How can I do that? Is it…
Übel Yildmar
  • 491
  • 1
  • 9
  • 24
2
votes
1 answer

Need help colouring variables and adding ellipses to PCA in R

I'm new to R and am trying to figure out how to do PCA using it. So far I have tried two methods but there are issues with both. Here is the code for the first: library('FactoMineR') my.data.7 <- read.csv("Principal Component Analysis Input 2.csv",…
1
vote
2 answers

Importing data for k-means clustering

I'm trying to follow this https://uc-r.github.io/kmeans_clustering library(tidyverse) # data manipulation library(cluster) # clustering algorithms library(factoextra) # clustering algorithms & visualization distance <-…
damo
  • 463
  • 4
  • 14
1
vote
1 answer

How to adjust rect_border to accept multiple colours like other colour palettes?

I am unable to pass other color schemes into rect_border but it somehow works when the colour palette lancet is specified. How can I adjust the second plot to work on the smooth_rainbow colours? See reprex…
1
vote
0 answers

Specify both different pointshapes and color by group for ind in fviz_mfa_ind?

Is there any way of specifying both a 1) shape for individual points by a grouping variable, and 2) color for individual points by a different grouping variable in fviz_mfa_ind() from R package FactoExtra? Specificizing a group in "habillage" as in…
c_j
  • 11
  • 2
1
vote
0 answers

How do I resolve the overlap in fviz_pca_biplot in factoextra packages

In the following command, whose shape output is also known, I have the problem of overlap in the specified area. I want all correlation lines to have labels without overlapping. I used the geom_label_repel command, but I got an…
1
vote
1 answer

In R package `factoextra` , using `get_dist`can calculate distance between variables,how to change the result into data.frame format

In R package factoextra , using get_distcan calculate distance between variables,how to change the result into data.frame format ? Thanks! Below code return cannot coerce class ‘"dist"’ to a data.frame library(factoextra) data("USArrests") res.dist…
anderwyang
  • 1,801
  • 4
  • 18
1
vote
1 answer

how to avoid overlap text in result of PCA biplot

the below plot obtains from this script, but much of the text is overlapping, I want to be displayed separately. fviz_pca_biplot(res.pca, labelsize=3, addEllipses = T, repel=F, #…
rezgar
  • 114
  • 8