barplot_contrib {GDAtools}R Documentation

Bar plot of contributions

Description

From MCA results, plots contributions to the axes.

Usage


barplot_contrib(resmca, dim = 1, which = "var",
  sort = FALSE, col = "tomato4", repel = FALSE)
  

Arguments

resmca

object of class MCA, speMCA, csMCA, PCA or CA

dim

the dimension to use. Default is 1.

which

If resmca is of class MCA, speMCA, csMCA or PCA, should be "var" to plot contributions of variables or "ind" to plot contributions of individuals. If resmca is of class CA, should be "row" to plot contributions of rows or "col" to plot contributions of columns. Default is "var".

sort

logical. If TRUE, bars are sorted by decreasing VIPs. Default is FALSE.

col

color of the bars

repel

logical. If TRUE, the names of the variables are repelled with geom_text_repel. Default is FALSE

Details

The contributions are multiplied by the sign of the coordinates, so that the plot shows on which side of the axis they contribute, which makes the interpretation easier.

Value

a ggplot2 object

Author(s)

Nicolas Robette

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

speMCA, tabcontrib

Examples

# specific MCA on the Music example data set
data(Music)
junk <- c("FrenchPop.NA", "Rap.NA", "Rock.NA", "Jazz.NA", "Classical.NA")
mca <- speMCA(Music[,1:5], excl = junk)
# contributions of categories
barplot_contrib(mca)

[Package GDAtools version 2.1 Index]