HCPC_tab {ggfacto} | R Documentation |
Multiple Tables for Hierarchical Clusters
Description
Multiple Tables for Hierarchical Clusters
Usage
HCPC_tab(
data,
row_vars = character(),
clust,
wt,
excl = character(),
color = "diff",
pct = "col",
row_tot = "% of population",
...
)
Arguments
data |
A data frame. |
row_vars |
<tidy-select> The row variables of the table, to cross with the clusters. Typically, actives variables of the MCA. |
clust |
In columns, the variable with the clusters, typically made with hierarchical
clustering functions like |
wt |
The name of the weight variable. Leave empty for unweighted results. |
excl |
The name of the levels to exclude, as a character vector. |
color |
The type of colors to print, see |
pct |
The type of percentages to print, see |
row_tot |
The name of the total line (frequencies of each cluster) |
... |
Additional arguments to pass to |
Value
A tibble
of class tab
, possibly with colored reading helpers.
Examples
data(tea, package = "FactoMineR")
res.mca_3axes <- MCA2(tea, active_vars = 1:18, ncp = 3)
cah <- FactoMineR::HCPC(res.mca_3axes, nb.clust = 6, graph = FALSE)
tea$clust <- cah$data.clust$clust
HCPC_tab(tea, row_vars = all_of(names(tea)[1:18]), clust = "clust") #|>
#tabxplor::tab_kable()