Learn R Programming

dimensio (version 0.10.1)

subset: Extract Parts of an Object

Description

Operators acting on objects to extract parts.

Usage

# S4 method for CA,ANY,missing
[[(x, i)

# S4 method for PCA,ANY,missing [[(x, i)

Value

A list.

Arguments

x

An object from which to extract element(s) or in which to replace element(s).

i

A character string specifying elements to extract. Any unambiguous substring can be given (see details).

Author

N. Frerebeau

Details

If i is "data", returns a list with the following elements:

data

A numeric matrix of raw data.

mean

A numeric vector giving the variables means (PCA).

sd

A numeric vector giving the variables standard deviations (PCA).

If i is "rows", returns a list with the following elements:

coord

A numeric matrix of rows/individuals coordinates.

cos2

A numeric matrix of rows/individuals squared cosine.

masses

A numeric vector giving the rows masses/individual weights.

sup

A logical vector specifying whether a point is a supplementary observation or not.

If i is "columns", returns a list with the following elements:

coord

A numeric matrix of columns/variables coordinates.

cor

A numeric matrix of correlation between variables and the dimensions (PCA).

cos2

A numeric matrix of columns/variables squared cosine.

masses

A numeric vector giving the columns masses/variable weights.

sup

A logical vector specifying whether a point is a supplementary observation or not.

If i is "eigenvalues", returns a numeric vector of eigenvalues.

See Also

Other mutators: dimnames(), loadings()

Examples

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

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

## Get results for the individuals
X[["rows"]]

Run the code above in your browser using DataLab