pca_coda {nexus} | R Documentation |
Principal Components Analysis
Description
Computes a principal components analysis based on the singular value decomposition.
Usage
## S4 method for signature 'CompositionMatrix'
pca(
object,
center = TRUE,
scale = FALSE,
rank = NULL,
sup_row = NULL,
sup_col = NULL,
weight_row = NULL,
weight_col = NULL
)
## S4 method for signature 'LogRatio'
pca(
object,
center = TRUE,
scale = FALSE,
rank = NULL,
sup_row = NULL,
sup_col = NULL,
weight_row = NULL,
weight_col = NULL
)
Arguments
object |
A |
center |
A |
scale |
A |
rank |
An |
sup_row |
A |
sup_col |
A |
weight_row |
A |
weight_col |
A |
Value
A dimensio::PCA
object. See package dimensio for details.
Author(s)
N. Frerebeau
References
Aitchison, J. and Greenacre, M. (2002). Biplots of compositional data. Journal of the Royal Statistical Society: Series C (Applied Statistics), 51: 375-392. doi:10.1111/1467-9876.00275.
Filzmoser, P., Hron, K. and Reimann, C. (2009). Principal component analysis for compositional data with outliers. Environmetrics, 20: 621-632. doi:10.1002/env.966.
See Also
dimensio::pca()
, dimensio::biplot()
, dimensio::screeplot()
,
dimensio::viz_individuals()
, dimensio::viz_variables()
Examples
## Data from Day et al. 2011
data("kommos", package = "folio") # Coerce to compositional data
kommos <- remove_NA(kommos, margin = 1) # Remove cases with missing values
coda <- as_composition(kommos, groups = 1) # Use ceramic types for grouping
## Centered log-ratio
clr <- transform_clr(coda)
## PCA
X <- pca(clr, scale = FALSE)
## Explore results
viz_individuals(X, highlight = get_groups(coda), pch = 16)
viz_variables(X)