ggadd_interaction.Rd
Adds the interactions between two categorical supplementary variables to a MCA cloud of variables
ggplot2
object with the cloud of variables
object created with MCA
, speMCA
, csMCA
, wcMCA
, bcMCA
, stMCA
or multiMCA
function
Factor. The first categorical supplementary variable.
Factor. The second categorical supplementary variable.
Numeric vector of indexes of the categories of the first supplementary variable to be used in interaction. By default, every categories are used.
Numeric vector of indexes of the categories of the second supplementary variable to be used in interaction. By default, every categories are used.
numeric vector of length 2, specifying the components (axes) to plot. Default is c(1,2).
Size of the labels of categories. Default is 5.
Logical. Whether to add gray dashed lines between the points of the categories. Default is TRUE.
the position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector). Default is none.
Force of repulsion between overlapping text labels. Defaults to 1. If 0, labels are not repelled at all.
Exclude text labels that overlap too many things. Defaults to Inf, which means no labels are excluded.
a ggplot2
object
Lines and labels are colored according to the variables, using the default ggplot2
palette. The palette can be customized using any scale_color_*
function, such as scale_color_brewer()
, scale_color_grey()
or scale_color_manual()
.
Le Roux B. and Rouanet H., Multiple Correspondence Analysis, SAGE, Series: Quantitative Applications in the Social Sciences, Volume 163, CA:Thousand Oaks (2010).
Le Roux B. and Rouanet H., Geometric Data Analysis: From Correspondence Analysis to Stuctured Data Analysis, Kluwer Academic Publishers, Dordrecht (June 2004).
# specific MCA of Taste example data set
data(Taste)
junk <- c("FrenchPop.NA", "Rap.NA", "Rock.NA", "Jazz.NA", "Classical.NA",
"Comedy.NA", "Crime.NA", "Animation.NA", "SciFi.NA", "Love.NA",
"Musical.NA")
mca <- speMCA(Taste[,1:11], excl = junk)
# interaction between Gender and Age
p <- ggcloud_variables(mca, col = "lightgrey", shapes = FALSE)
ggadd_interaction(p, mca, Taste$Gender, Taste$Age)