- (development version)
fviz_dend():lwdnow controls ggplot branch thickness correctly and no longer triggers a spurious linewidth legend. (#200, @erdeyl)get_famd(),get_mfa(),facto_summarize(),fviz_famd_*(), andfviz_mfa_*()now support supplementary qualitative variable categories viaquali.sup, including the related overlay, print, and category-name compatibility paths. Regression coverage and examples were expanded accordingly. (#202, @erdeyl)
Major modernization release after 6 years. Resolves 30+ open issues and aligns with the current R/ggplot2/FactoMineR ecosystem.
- R >= 4.1.0 required (was >= 3.1.2).
- ggplot2 >= 3.5.2 required (previously no minimum).
- FactoMineR >= 2.13 required.
get_clust_tendency(): Hopkins statistic now uses the corrected Wright (2022) formula — values will differ from earlier versions. Defaultseedchanged from123toNULL.- tidyr and reshape2 no longer needed — replaced with base R internally.
- Replaced all
aes_string()withaes()+.datapronoun (rlang). (#188, #190, #191, #192) - Replaced
guides(... = FALSE)withguides(... = "none"). (#141, #156, #174, #179, #183) - Replaced
sizewithlinewidthfor line-based geoms. (#178, #191)
fviz_dend(): fixedrect_bordererror and "condition has length > 1" crash. (#151, #163, #180)fviz_nbclust(): fixed class-comparison crash, cluster ordering for k > 9, and silhouette error when k >= n. (#113, #131, #147, #148, #149, #171)facto_summarize(): axes parameter now correctly selects requested dimensions. (#120, #143, #166, #167)fviz_ca_col(): fixedcol.col.supparameter name typo. (#150)fviz_pca_biplot(): fixed rescaling. (#129)get_clust_tendency(): fixed biased Hopkins sampling. (#133).onAttach(): startup message no longer falsely claims ggpubr/FactoMineR are "loaded" (they are imported, not attached)..add_ind_groups(): no longer crashes with single-column habillage data frame.
fviz_eig(): parallel analysis support (Horn 1965).fviz_pca_biplot(): scaling types (Gabriel 1971).get_clust_tendency(): stricter input validation, RNG state preservation,options(factoextra.warn_hopkins = FALSE)to suppress one-time warning.hcut()andhkmeans(): improved input checks and error handling. Redundantk >= nchecks removed to preserve backward-compatible error messages fromcutree()/kmeans()(avoids breaking reverse dependencies such aschooseGCM). (@erdeyl, #199)- Expanded
testthattest suite (113 tests). (@erdeyl, #199) - GitHub Actions R-CMD-check workflow.
- CA/MCA/PCA extractor internals refactored to vectorized, type-stable code.
factominer_category_map()andmap_factominer_legacy_names()helpers for FactoMineR category-name compatibility.clean_lock_files()helper for removing stale00LOCK-*directories.- Added
LazyDataCompression: xzfor CRAN compliance. - Laszlo Erdey added as contributor.
- Adding stringsAsFactors = TRUE to the relevant calls to data.frame to anticipate compatibility with future R 4.0.0
- the function
fviz_nbclust()checks now whether the argumentFUNclusteris correctly specified (@robsalasco, #82). - Clusters are now correctly order in
fviz_mclust_bic()(@hpsprecher, #84) - New arguments
outlier.pointsizeandoutlier.labelsizeadded infviz_cluster()to customize outliers detected with DBSCAN (@choonghyunryu, #74) pointsizein the functionfviz()canbe now a continuous variable.
- Now
hkmeans()takes other distance metrics (@santsang, #52) get_clust_tendency()updated to return the correct value of hopkins statistics as explained at: https://www.datanovia.com/en/lessons/assessing-clustering-tendency/
- Now, the argument
invisibleworks properly in the functionfviz_pca_biplot()(@ginolhac, #26). - The function
fviz_dend()now works for an object of classdiana(@qfazille, #30). - Now,
fviz_cluster()supports HCPC results (@famuvie, #34).
-
New argument
mean.pointin the functionfviz(). logical value. If TRUE, group mean points are added to the plot. -
Now, PCA correlation circles have fixed coordinates so they don't appear as ellipses (@scoavoux, #38.
-
New argument
fill.indandfill.varadded infviz_pca()(@ginolhac, #27 and @Confurious, #42). -
New arguments
geom.indandgeom.varinfviz_pca_xxx()andfviz_mca_xxx()functions to have more controls on the individuals/variables geometry in the functionsfviz_pca_biplot()andfviz_mca_biplot()(@Confurious, #42). -
New arguments
geom.rowandgeom.colinfviz_ca_xxx()functions to have more controls on the individuals/variables geometry in the functionfviz_ca_biplot()(@Confurious, #42). -
New argument
gradient.colsinfviz_pca_biplot() -
New argument
àxesinfviz_cluster() to specify the dimension to plot. -
New argument
circlesizein the functionfviz()to change the size of the variable correlation circle size. -
It's now possible to color individuals using a custom continuous variable (#29). This is done using the argument col.ind.
library(factoextra)
data(iris)
res.pca <- prcomp(iris[, -5], scale = TRUE)
# Visualize and color by a custom continuous variable
fviz_pca_ind(res.pca, col.ind = iris$Sepal.Length,
legend.title = "Sepal.Length")- factoextra can now handle Japanese characters by using the argument font.family = "HiraKakuProN-W3"` (#31). For example:
library(FactoMineR)
library(factoextra)
.tbl2.1 <- matrix(c(395, 2456,1758,
147, 153, 916,
694, 327, 1347),byrow=T,3,3)
dimnames(.tbl2.1) <- list(地域=c("オスロ","中部地域","北部地域"),
犯罪=c("強盗", "詐欺","破壊") )
res.CA <- CA(.tbl2.1,graph=FALSE)
fviz_ca_biplot(res.CA,map="simbiplot",title="simbiplot",
font.family = "HiraKakuProN-W3")-
New function
fviz_mclust()for plotting model-based clustering using ggplot2. -
New function
fviz(): Generic function to create a scatter plot of multivariate analyse outputs, including PCA, CA and MCA, MFA, ... -
New functions
fviz_mfa_var()andfviz_hmfa_var()for plotting MFA and HMFA variables, respectively. -
New function
get_mfa_var(): Extract the results for variables (quantitatives, qualitatives and groups). Deprecated functions:get_mfa_var_quanti(),get_mfa_var_quali()andget_mfa_group(). -
New functions added for extracting and visualizing the results of FAMD (factor analysis of mixed data):
get_famd_ind(),get_famd_var(),fviz_famd_ind()andfviz_famd_var(). -
Now
fviz_dend()returns a ggplot. It can be used to plot circular dendrograms and phylogenic-like trees. Additionnally, it supports an object of class HCPC (from FactoMineR). -
New arguments in
fviz_cluster():- main, xlab, ylab in
fviz_cluster(): to change the plot main title and axis labels. - ellipse, ellipse.type, ellipse.level and ellipse.alpha
- choose.vars: a character vector containing variables to be considered for plotting.
- main, xlab, ylab in
-
New argument pointshape in
fviz_pca(). When you use habillage, point shapes change automatically by groups. To avoid this behaviour use for example pointshape = 19 in combination with habillage (@raynamharris, #15). -
New argument repel in
fviz_add(). -
New argument gradient.cols in fviz_*() functions.
-
Support for the ExPosition package added (epCA, epPCA, epMCA) (#23)
-
Check point added in the function
fviz_nbclust()to make sure that x is an object of class data.frame or matrix (Jakub Nowosad, #15). -
The following arguments are deprecated in
fviz_cluster(): title, frame, frame.type, frame.level, frame.alpha. Now, use main, ellipse, ellipse.type, ellipse.level and ellipse.alpha instead. -
Now, by default, the function
fviz_cluster() doesn't show cluster mean points for an object of class PAM and CLARA, when the argument show.clust.cent is missing . This is because cluster centers are medoids in the case of PAM and CLARA but not means. However, user can force the function to display the mean points by using the argument show.clust.cent = TRUE. -
The argument jitter is deprecated; use repel = TRUE instead, to avoid overlapping of labels.
-
New argument "sub" in
fviz_dend()for adding a subtitle to the dendrogram. If NULL, the method used hierarchical clustering is shown. To remove the subtitle use sub = "".
- Now
fviz_cluster()can handle HCPC object obtained from MCA (Alejandro Juarez-Escario, #13) - Now
fviz_ca_biplot()reacts when repel = TRUE used - In
facto_summarize(), now the contribution values computed for >=2 axes are in percentage (#22) fviz_ca()andfviz_mca()now work with the latest version of ade4 v1.7-5 (#24)
-
New fviz_mfa function to plot MFA individuals, partial individuals, quantitive variables, categorical variables, groups relationship square and partial axes (@inventionate, #4).
-
New fviz_hmfa function to plot HMFA individuals, quantitive variables, categorical variables and groups relationship square (@inventionate, #4).
-
New get_mfa and get_hmfa function (@inventionate, #4).
-
fviz_ca, fviz_pca, fviz_mca, fviz_mfa and fviz_hmfa ggrepel support (@inventionate, #4).
-
Updated fviz_summarize, eigenvalue, fviz_contrib and fviz_cos2 functions, to compute FactoMineR MFA and HMFA results (@inventionate, #4).
-
fviz_cluster() added. This function can be used to visualize the outputs of clustering methods including: kmeans() [stats package]; pam(), clara(), fanny() [cluster package]; dbscan() [fpc package]; Mclust() [mclust package]; HCPC() [FactoMineR package]; hkmeans() [factoextra].
-
fviz_silhouette() added. Draws the result of cluster silhouette analyses computed using the function silhouette()[cluster package]
-
fviz_nbclust(): Dertemines and visualize the optimal number of clusters
-
fviz_gap_stat(): Visualize the gap statistic generated by the function clusGap() [in cluster package]
-
hcut(): Computes hierarchical clustering and cut the tree into k clusters.
-
hkmeans(): Hierarchical k-means clustering. Hybrid approach to avoid the initial random selection of cluster centers.
-
get_clust_tendency(): Assessing clustering tendency
-
fviz_dend(): Enhanced visualization of dendrogram
-
eclust(): Visual enhancement of clustering analysis
-
get_dist() and fviz_dist(): Enhanced Distance Matrix Computation and Visualization
-
eclust(): Visual enhancement of clustering analysis
- Require R >= 3.1.0
- A dataset named "multishapes" has been added. It contains clusters of multiple shapes. Useful for comparing density-based clustering and partitioning methods such as k-means
- The argument jitter is added to the functions fviz_pca(), fviz_mca() and fviz_ca() and fviz_cluster() in order to reduce overplotting of points and texts
- The functions fviz_*() now use ggplot2::stat_ellipse() for drawing ellipses.
- Unknown parameters "shape" removed from geom_text (@bdboy, #5)
- Visualization of Correspondence Analysis outputs from different R packages (FactoMineR, ca, ade4, MASS)
- fviz_ca_row()
- fviz_ca_col()
- fviz_ca_biplot()
- Extract results from CA output
- get_ca_row()
- get_ca_col()
- get_ca()
- Visualize the cos2 and the contributions of rows/columns. The functions can handle the output of PCA, CA and MCA
- fviz_cos2()
- fviz_contrib()
- Sumarize the results of PCA, CA, MCA
- facto_summarize()
- fviz_pca_contrib() is dreprecated -> use fviz_contrib()
- fviz_add: "text" are included in the allowed values for the argument geom
- fviz_screeplot: the X parameter can be also an object of class ca [ca], coa [ade4], correspondence [MASS]
- get_eigenvalue: X parameters and description changed
- get_pca_ind: the argument data are no longer required
- Easy to use functions to extract and visualize the output of principal component analysis.