
Use Gaussian Mixture Models to cluster selected variables
Source:R/cluster_selected_vars.R
cluster_selected_vars.Rd
Use Gaussian Mixture Models to cluster selected variables
Examples
clustering <- cluster_selected_vars(study_data)
clustering
#> 'Mclust' model object: (EVE,3)
#>
#> Available components:
#> [1] "call" "data" "modelName" "n"
#> [5] "d" "G" "BIC" "loglik"
#> [9] "df" "bic" "icl" "hypvol"
#> [13] "parameters" "z" "classification" "uncertainty"
if (requireNamespace("dplyr")) {
data.frame(cluster = clustering$classification) |>
dplyr::reframe(n = dplyr::n(), .by = cluster)
}
#> cluster n
#> 1 2 34
#> 2 1 30
#> 3 3 32