addLines4MCA | R Documentation |
ggplot2
) add lines to the levels of
the qualitative variables in a (variable) factorial
map of an MCA (e.g., computed with
ExPosition::epMCA
).addLines4MCA
is a ggplot2
based function that
adds lines to join the levels of
the qualitative variables in a factorial
map of an MCA (e.g., computed with
ExPosition::epMCA
and created with
createFactortMap
).
addLines4MCA(
Fj,
col4Var,
alpha = 0.7,
linetype = 3,
size = 0.5,
axis_h = 1,
axis_v = 2,
dimension.names = "Dimension",
...
)
Fj |
the output for the column set of an
MCA (e.g., from |
col4Var |
vector of colors for the variables.
if col4Var is not equal to the number
of qualitative variables |
alpha |
(Default: 0.7) the alpha values for the lines. |
linetype |
(Default: 3, dotted) the linetype number for the lines. |
size |
(Default: .5) the size of the lines. |
axis_h |
(Default: 1) what is the horizontal axis. |
axis_v |
(Default: 2) hat is the verical axis. |
dimension.names |
(Default: |
... |
Everything else that can be passed to
|
The levels of a given variable
are first ordered by alphabetical order prior
to drawing the lines
(so, e.g., truc.1
, truc.2
and truc.3
will be correctly ordered).
The name (i.e., stem) of a variable is obtained
by stripping the names of the levels (i.e., columns)
of the extension after the last "." of their names.
For example, the name toto.1
for
a row of Fj
corresponds to the qualitative
variable toto
.
A list with the lines for each variables
When creating multiple layers graphs,
because of the way ggplot2
creates graphs,
all the matrices/dataframe should all
the have the same column names
(e.g., colnames()
equal to c("Dimension 1", "Dimension 2")
).
When this is not the case,
some strange and cryptic error may be produced
(e.g., "cannot find Dimension"
).
prettyGraphsColorSelection
getVarNames
## Not run:
if(interactive()){
library{ExPosition}
data("mca.wine")
resMCA <- epMCA(mca.wine$data, graphs = FALSE)
Fj <- resMCA$ExPosition.Data$fj
baseMap4J <- createFactorMap(Fj)$zeMap +
addLines4MCA(Fj,col4Var = rep('red',10) )
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.