View source: R/functions_build_plot.r
add.ellipse | R Documentation |
Add a layer with concentration ellipses to an mca map.
add.ellipse(
object,
var = NULL,
draw = unique(var),
dim = c(1, 2),
el = ellipses(object, var = var, dim = dim),
mapping = aes(color = Category),
draw.axis = TRUE,
...
)
object |
a soc.mca result object |
var |
a factor |
draw |
a character vector with the levels to draw ellipses for |
dim |
a numeric vector with the dimensions for the plane |
el |
a data.frame produced by the ellipses function. |
mapping |
a call to aes from the ggplot2 package. Here you can map aesthetics to variables such as color, fill, alpha, size and linetype. |
draw.axis |
if TRUE the axis within the concentration ellipse is drawn. |
... |
further arguments is passed onto geom_path and geom_line |
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.ind(result, mapping = aes(color = sup$Gender)) + add.ellipse(result, sup$Gender)
map.ca.base() + add.ind(result, mapping = aes(color = sup$Age == "65+")) + add.ellipse(result, sup$Age == "65+", draw = "TRUE")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.