View source: R/geometrical_data_analysis.R
MCA2 | R Documentation |
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
.
MCA2(data, active_vars, wt, excl, ncp = 5, graph = FALSE, ...)
data |
The data frame. |
active_vars |
<tidy-select> |
wt |
<tidy-select> |
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 |
A 'res.mca' object, with all the data necessary to draw the MCA.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.