Learn R Programming

dimensio (version 0.9.0)

viz_contributions: Visualize Contributions and cos2

Description

Plots contributions histogram and \(cos^2\) scatterplot.

Usage

viz_contributions(x, ...)

viz_cos2(x, ...)

# S4 method for MultivariateAnalysis viz_contributions( x, ..., margin = 2, axes = 1, sort = TRUE, decreasing = TRUE, limit = 10, horiz = FALSE, col = "grey90", border = "grey10" )

# S4 method for MultivariateAnalysis viz_cos2( x, ..., margin = 2, axes = c(1, 2), active = TRUE, sup = TRUE, sort = TRUE, decreasing = TRUE, limit = 10, horiz = FALSE, col = "grey90", border = "grey10" )

Value

viz_contributions() and viz_cos2() are called for their side-effects: they result in a graphic being displayed. Invisibly return x.

Arguments

x

A CA, MCA or PCA object.

...

Extra parameters to be passed to graphics::barplot().

margin

A length-one numeric vector giving the subscript which the data will be returned: 1 indicates individuals/rows (the default), 2 indicates variables/columns.

axes

A numeric vector giving the dimensions to be plotted.

sort

A logical scalar: should the data be sorted?

decreasing

A logical scalar: should the sort order be decreasing? Only used if sort is TRUE.

limit

An integer specifying the number of top elements to be displayed.

horiz

A logical scalar: should the bars be drawn horizontally with the first at the bottom?

col, border

A character string specifying the bars infilling and border colors.

active

A logical scalar: should the active observations be plotted?

sup

A logical scalar: should the supplementary observations be plotted?

Author

N. Frerebeau

Details

The red dashed line indicates the expected average contribution (variables with a contribution larger than this cutoff can be considered as important in contributing to the component).

See Also

Other plot methods: biplot(), plot(), screeplot(), viz_individuals(), viz_variables(), viz_wrap, wrap

Examples

Run this code
## Load data
data("iris")

## Compute principal components analysis
X <- pca(iris, scale = TRUE)

## Get row contributions
head(get_contributions(X, margin = 1))

## Plot contributions
viz_contributions(X, axes = 1)

## Plot cos2
viz_cos2(X)

Run the code above in your browser using DataLab