MCA2 {ggfacto} | R Documentation |
Multiple Correspondence Analysis
Description
A user-friendly wrapper around MCA
, made to
work better with ggfacto functions like ggmca
. All variables can
be selected by many different expressions, in the way of the 'tidyverse'.
No supplementary vars are to be provided here, since they can be added afterward
in ggmca
.
Usage
MCA2(data, active_vars, wt, excl, ncp = 5, graph = FALSE, ...)
Arguments
data |
The data frame. |
active_vars |
|
wt |
|
excl |
A character vector of regular expressions to exclude "junk" categories. Any level of an active variable with any of the detected patterns is not taken into account in the calculation of axes (which is called specific multiple correspondence analysis). |
ncp |
The number of axes to keep. Default to 5. |
graph |
By default no graph is made, since the result can be ploted with
|
... |
Additionnal arguments to pass to |
Value
A 'res.mca' object, with all the data necessary to draw the MCA.
Examples
data(tea, package = "FactoMineR")
res.mca <- MCA2(tea, active_vars = 1:18)
res.mca %>%
ggmca(tea, sup_vars = c("SPC"), ylim = c(NA, 1.2), text_repel = TRUE) %>%
ggi() #to make the graph interactive