DetermineClusters {jrSiCKLSNMF} | R Documentation |
Perform clustering diagnostics
Description
A wrapper for the clValid
and fviz_nbclust
functions to perform clustering diagnostics
Usage
DetermineClusters(
SickleJr,
numclusts = 2:20,
clusteringmethod = "kmeans",
diagnosticmethods = c("wss", "silhouette", "gap_stat"),
clValidvalidation = "internal",
createDiagnosticplots = TRUE,
runclValidDiagnostics = TRUE,
printPlots = TRUE,
printclValid = TRUE,
subset = FALSE,
subsetsize = 1000,
seed = NULL
)
Arguments
SickleJr |
An object of class SickleJr |
numclusts |
A vector of integers indicating the number of clusters to test |
clusteringmethod |
String holding the clustering method: defaults to k-means; since the other methods are not implemented in jrSiCKLSNMF, it is recommended to use k-means. |
diagnosticmethods |
Vector of strings indicating which methods to plot. Defaults to all three of the available: wss, silhouette, and gap_stat |
clValidvalidation |
String containing validation method to use for |
createDiagnosticplots |
Boolean indicating whether to create diagnostic plots for cluster size |
runclValidDiagnostics |
Boolean indicating whether to calculate the diagnostics from |
printPlots |
Boolean indicating whether to print the diagnostic plots |
printclValid |
Boolean indicating whether to print the diagnostic results from |
subset |
Boolean indicating whether to calculate the diagnostics on a subset of the data rather than on the whole dataset. |
subsetsize |
Numeric value indicating size of the subset |
seed |
Numeric value holding the random seed |
Value
An object of class SickleJr with cluster diagnostics added to its clusterdiagnostics
slot
References
Brock G, Pihur V, Datta S, Datta S (2008). “clValid: An R Package for Cluster Validation.” Journal of Statistical Software, 25(4), 1–22. https://www.jstatsoft.org/v25/i04/.
Kassambara A, Mundt F (2020). factoextra: Extract and Visualize the Results of Multivariate Data Analyses. R package version 1.0.7, https://CRAN.R-project.org/package=factoextra.
Examples
#Since these data are too small, the clValid diagnostics do not run
#properly. See the vignette for an example with the clValid diagnostics
SimSickleJrSmall<-DetermineClusters(SimSickleJrSmall,numclusts=2:5,runclValidDiagnostics=FALSE)