View source: R/functions_build_plot.r
add.categories | R Documentation |
Add a layer of categories (modalities) to an mca map
The presets adds, replaces or filters from the categories in cats.
"ctr" returns all categories contributing above average to the plane
defined in dim. "sup" returns the supplementary categories from object.
"all" returns both supplementary and active categories.
object |
a soc.mca result object |
preset |
a character string selecting among presets. If "active" - no change is made to "cats". |
dim |
a numeric vector with the dimensions for the plane |
cats |
a data.frame with coordinates of categories as produced by extract_mod or extract_sup. This controls the plotted points. |
mapping |
a call to aes from the ggplot2 package. Here you can map aesthetics to variables such as color, alpha, size and family. |
repel |
if TRUE label position is adjusted to lower overlap |
check_overlap |
if TRUE overlapping categories are removed |
points |
if TRUE points are plotted |
... |
further arguments are passed onto geom_text or geom_text_repel |
a ggplot2 object that can be added to an existing plot like those produced by map.ca.base
example(soc.mca)
map.ca.base() + add.categories(result, check_overlap = TRUE)
map.ca.base() + add.categories(result, preset = "all", mapping = aes(color = type, label = Modality), repel = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.