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
6
votes
1 answer

Adding labels to Cluster

I'm new to R and am attempting to cluster some data based on industry. I have learned that K-means cannot handle factors and categorical data. I have removed the factor called 'Industry' -- 67 distinct observations -- from my dataset but would like…
13ISPaulGeorge
  • 117
  • 1
  • 6
5
votes
1 answer

R PCA : With the fviz_pca_ind function, can we have two categorical variables: one point shape and one fill color?

I am trying to make a PCA plot with individuals -where one categorical variable (A) would be represented as the point shape (eg one group as a circle, a second one as a square, etc.) -and a second categorical variable (B) as the color inside the…
Xav64
  • 139
  • 1
  • 8
5
votes
2 answers

PCA analysis remove centroid

I am using fviz_pca_ind to make PCA plot see below. fviz_pca_ind(res.pca, geom="point", pointsize = 1, habillage=iris$Species, addEllipses=TRUE, ellipse.level=0.95 , palette = c("green", "orange", "grey")) I want to remove the…
Al14
  • 1,734
  • 6
  • 32
  • 55
4
votes
1 answer

Rstudio error with the fviz_nbclust() function

I'm doing a report for a data analysis and statistical learning subject. The problem is in the clustering phase. I have to find the optimal number of clusters, and i already done. But when i try to display the graph with the following function it…
Turex
  • 41
  • 1
  • 6
4
votes
1 answer

Delete or hide the data points' labels

I have the dataframe below : Val1<-c(0.5,0.7,0.8,0.9) Val2<-c(0.5,0.7,0.8,0.9) Val3<-c(0.5,0.7,0.8,0.9) Val4<-c(0.5,0.7,0.8,0.9) vales<-data.frame(Val1,Val2,Val3,Val4) row.names(vales)<-c("asd","dasd","dfsdf","fdff") which I process properly in…
firmo23
  • 7,490
  • 2
  • 38
  • 114
4
votes
2 answers

R Biplot with clusters as colors

I'm doing a clustering after a PCA transformation and I would like to visualize the results of the clustering in the first two or three dimensions of the PCA space as well as the contribution from the original axes to the projected PCA ones. I use…
alberto
  • 2,625
  • 4
  • 29
  • 48
3
votes
1 answer

How to display observations in pca biplot?

I'm hoping to display observation row names on a principal component analysis biplot using the factoextra package. library(factoextra) ## organize dataset to obtain unique rownames iris$id <- rownames(iris) iris$id <- paste(iris$Species, iris$id,…
3
votes
1 answer

Specify different pointshapes for var and ind in fviz_pca_biplot

Is there any way of specifying shape for variables in fviz_pca_biplot() from R package FactoExtra? For example I have the following code: data("iris") PCA.iris <- prcomp(iris[ , -5], scale=TRUE) BiPlot<- fviz_pca_biplot(PCA.iris, …
Nanna
  • 73
  • 8
3
votes
1 answer

Remove or hide zeroline on R ggplot2/factoextra plots

I am using this factoextra package in R to do Correspondent Analysis. When I print out the result plot, I can't find the option to hide the x and y zeroline. I know that the theme setting is based on ggplot2. Can anyone help me to figure out how…
backpackerice
  • 87
  • 1
  • 9
3
votes
2 answers

how to print the optimal number of clusters using fviz_nbclust

I need a help to know how to find the optimal number of number of clusters using k-means cluster in R. My code is library(cluster) library(factoextra) #read data data<-read.csv("..\file.txt",header=FALSE, sep=" ") #determine number of clusters to…
user4544869
  • 53
  • 1
  • 5
3
votes
1 answer

Factoextra - change line width for ellipses and variables

I'm currently making pca with factomineR and factoextra packages. An example of my code with data iris : library(FactoMineR) library(factoextra) data(iris) res.pca<-PCA(iris , scale.unit=TRUE, ncp=2, quali.sup=c(5), graph = …
vbou
  • 31
  • 1
  • 2
3
votes
1 answer

R function to create and save graphic

I am trying to create and save several graphics. I am stuck in the case that the factoextra package is used to make the graphs. pca.plot<-function(x){ biplot<-paste(out_f,"\\biplot.jpg", sep="") jpeg(file=biplot, type="cairo") …
2
votes
2 answers

How to assign colors for variables in "fviz_pca_biplot" from the R package "factoextra"?

I am trying to assign different colors for variables in a PCA biplot. However, fviz_pca_biplot from the R package factoextra can not plot the correct color for each variable. library(factoextra) data(iris) res.pca <- prcomp(iris[, -5], retx =…
Yang Yang
  • 858
  • 3
  • 26
  • 49
2
votes
0 answers

Interpreting the PCA axis Dim1 and Dim2 from CLARA plot results directly

I had a large dataset that contains more than 300,000 rows/observations and 22 variables. I used the CLARA method for the clustering and plotted the results using fviz_cluster. Using the silhouette method, I got 10 as my number of clusters and from…
2
votes
1 answer

Changing shapes on Factoextra

I'm a very new coder looking to change the shapes of my PCA Biplot. My PCA Biplot code is as follows: group <- c(rep("SHIME 1_Trt1", times=8), rep('SHIME 1_Trt2', times=6), rep("SHIME 2_Trt1", times=8), rep('SHIME 2_Trt2', times=6), rep("SHIME…
Coldgrad
  • 59
  • 7
1
2 3 4 5