Adds a categorical supplementary variable to a MCA cloud of variables.
ggplot2 object with the cloud of variables
object of class
Factor. The categorical supplementary variable. It does not need to have been used at the MCA step.
Numeric vector of indexes of the categories of the supplementary variable to be added to the plot. By default, labels are plotted for every categories.
numeric vector of length 2, specifying the components (axes) to plot. Default is c(1,2).
Character. Color of the shapes and labels of the categories. Default is black.
Symbol to be used in addition the the labels of categories (default is 1). If NULL, only labels are plotted.
If NULL, the size of the labels (if shape=NULL) or the shapes (otherwise) is constant. If 'n', the size is proportional the the weights of categories; if 'vtest1', the size is proportional to the test values of the categories on the first dimension of the plot; if 'vtest2', the size is proportional to the test values of the categories on the second dimension of the plot; if 'cos1', the size is proportional to the cosines of the categories on the first dimension of the plot; if 'cos2', the size is proportional to the cosines of the categories on the second dimension of the plot; if 'cos12', the size is proportional to the total cosines of the categories on the two dimensions of the plot.
Size of the labels of categories if shape is not NULL, or if shape=NULL and prop=NULL. Default is 3.
Size of the shapes if prop=NULL, maximum size of the shapes in other cases. Default is 6.
Logical. Should one add lines between categories ? Default is FALSE.
A character string to be used as a prefix for the labels of the categories. If NULL (default), no prefix is added.
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 Music example data set data(Music) junk <- c("FrenchPop.NA", "Rap.NA", "Rock.NA", "Jazz.NA", "Classical.NA") mca <- speMCA(Music[,1:5], excl = junk) # adds Age as a supplementary variable # onto the cloud of variables p <- ggcloud_variables(mca, col = "lightgrey", shapes = FALSE) ggadd_supvar(p, mca, Music$Age, segment = TRUE)