tidy: Tidy Coordinates

tidyR Documentation

Tidy Coordinates

Description

Tidy Coordinates

Usage

tidy(x, ...)

augment(x, ...)

## S4 method for signature 'MultivariateAnalysis'
augment(x, ..., margin = 1, axes = c(1, 2), principal = TRUE)

## S4 method for signature 'MultivariateAnalysis'
tidy(x, ..., margin = 1, principal = TRUE)

Arguments

x

A CA, MCA or PCA object.

...

Currently not used.

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 length-two numeric vector giving the dimensions to be for which to compute results.

principal

A logical scalar: should principal coordinates be returned? If FALSE, standard coordinates are returned.

Value

tidy() returns a long data.frame with the following columns:

label

Row/column names of the original data.

component

Component.

supplementary

Whether an observation is active or supplementary.

coordinate

Coordinates.

contribution

Contributions to the definition of the components.

cos2

cos^2.

augment() returns a wide data.frame of the row/column coordinates along axes and the following columns:

label

Row/column names of the original data.

supplementary

Whether an observation is active or supplementary.

mass

Weight/mass of each observation.

sum

Sum of squared coordinates along axes.

contribution

Joint contributions to the definition of axes.

cos2

Joint cos^2 along axes.

Author(s)

N. Frerebeau

See Also

Other summary: summary()

Examples

## Load data
data("iris")

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

## Get row principal coordinates
head(get_coordinates(X, margin = 1, principal = TRUE))

## Get row standard coordinates
head(get_coordinates(X, margin = 1, principal = FALSE))

## Tidy principal coordinates
head(tidy(X, margin = 1))
head(tidy(X, margin = 2))

head(augment(X, margin = 1, axes = c(1, 2)))
head(augment(X, margin = 2, axes = c(1, 2)))

dimensio documentation built on Nov. 25, 2023, 1:08 a.m.