ggadd_supind: Adds supplementary individuals to a cloud of individuals

Description Usage Arguments Details Author(s) See Also Examples

View source: R/ggadd_supind.R

Description

Adds supplementary individuals to a MCA cloud of the individuals, using the ggplot2 framework.

Usage

1
ggadd_supind(p, resmca, dfsup, axes=c(1,2), col="black", textsize=5, pointsize=2)

Arguments

p

ggplot object with the cloud of variables

resmca

object of class MCA, speMCA, csMCA, stMCA or multiMCA.

dfsup

data frame with the supplementary individuals. It must have the same factors as the data frame used as input for the initial MCA.

axes

numeric vector of length 2, specifying the dimensions (axes) to plot (default is c(1,2))

col

color for the labels and points of the individuals (default is black)

textsize

Size of the labels of the individuals. Default is 5.

pointsize

Size of the points of the individuals. If NULL, only labels are plotted. Default is 2.

Details

The function uses the row names of dfsup as labels for the individuals.

Author(s)

Nicolas Robette

See Also

indsup, ggcloud_indiv

Examples

1
2
3
4
5
6
7
8
9
## Performs a specific MCA on 'Music' example data set
## ignoring every 'NA' (i.e. 'not available') categories,
## plots the cloud of individuals,
## and then adds individuals 1, 20 and 300 as supplementary individuals.
data(Music)
rownames(Music) <- paste0("i", 1:nrow(Music))
mca <- speMCA(Music[,1:5], excl=c(3,6,9,12,15))
p <- ggcloud_indiv(mca, col="lightgrey")
ggadd_supind(p, mca, Music[c(1,20,300),1:5])

GDAtools documentation built on May 31, 2021, 5:08 p.m.