GDAtools (version 1.5)

ggcloud_indiv: Plots MCA cloud of individuals

Description

Plots a Multiple Correspondence Analysis cloud of individuals, using ggplots functions.

Usage

ggcloud_indiv(resmca, type='i', points='all', axes=1:2, 
col='dodgerblue4', palette='Set2', alpha=0.6, repel=FALSE)

Arguments

resmca

object of class 'MCA', 'speMCA' or 'csMCA'.

type

If 'i', points are plotted; if 'inames', labels of individuals are plotted.

points

character string. If 'all' all points are plotted (default); if 'besth' only those who contribute most to horizontal axis are plotted; if 'bestv' only those who contribute most to vertical axis are plotted; if 'best' only those who contribute most to horizontal or vertical axis are plotted.

axes

numeric vector of length 2, specifying the components (axes) to plot. Default is c(1,2).

col

If a factor, points or labels are colored according to their category regarding this factor. If a string with color name, every points or labels have the same color. Default is 'dodgerblue4'.

palette

If col is a factor, can be the name of a RColorBrewer palette, 'bw' for a black and white palette (uses scale_color_grey()) or a character vector with a custom palette. If NULL, ggplot2 palette is used. Default is 'Set2'.

alpha

Transparency of the points or labels of individuals. Default is 0.6.

repel

Logical. When type='inames', should labels of individuals be repeled ? Default is FALSE.

Value

a ggplot object

References

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).

See Also

ggcloud_variables, ggadd_ellipses, ggadd_supvar, ggadd_interaction

Examples

Run this code
# NOT RUN {
## Performs a specific MCA on 'Music' example data set
## ignoring every 'NA' (i.e. 'not available') categories,
## and then draws the cloud of individuals.
data(Music)
getindexcat(Music[,1:5])
mca <- speMCA(Music[,1:5],excl=c(3,6,9,12,15))
ggcloud_indiv(mca)
ggcloud_indiv(mca, col=Music$Gender, palette='Set2')
# }

Run the code above in your browser using DataLab