Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/ggcloud_indiv.R

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

1 2 3 |

`resmca` |
object of class |

`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 |

`size` |
Size of the points or labels of individuals. Default is 0.5. |

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

`density` |
If NULL (default), no density layer is added. If "contour", density is plotted with contours. If "hex", density is plotted with hexagon bins. |

`col.contour` |
character string. The color of the contours. Only used if density="contour". |

`hex.bins` |
integer. The number of bins in both vertical and horizontal directions. Only used if density="hex". |

`hex.pal` |
character string. The name of a viridis palette for hexagon bins. Only used if density="hex". |

Sometimes the dots are too many and overlap. It is then difficult to get an accurate idea of the distribution of the cloud of individuals. The "density" option allows you to add an additional layer to represent the density of points in the plane, in the form of contours or hexagonal areas.

a ggplot object

Anton Perdoncin, Nicolas Robette

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

`ggcloud_variables`

, `ggadd_ellipses`

, `ggadd_supvar`

, `ggadd_corr`

, `ggadd_interaction`

, `ggadd_density`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
## Performs a specific MCA on 'Taste' example data set
## ignoring every 'NA' (i.e. 'not available') categories,
## and then draws the cloud of individuals.
data(Taste)
getindexcat(Taste[,1:11])
mca <- speMCA(Taste[,1:11],excl=c(3,6,9,12,15,18,21,24,27,30,33))
ggcloud_indiv(mca)
# Points are colored according to gender
ggcloud_indiv(mca, col=Taste$Gender, palette='Set2')
# A density layer of contours is added
ggcloud_indiv(mca, density="contour")
# A density layer of hexagon bins is added
ggcloud_indiv(mca, density="hex", hex.bin=10)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.