methods-prcomp | R Documentation |
These methods extract data from, and attribute new data to,
objects of class "prcomp"
as returned by stats::prcomp()
.
## S3 method for class 'prcomp' as_tbl_ord(x) ## S3 method for class 'prcomp' recover_rows(x) ## S3 method for class 'prcomp' recover_cols(x) ## S3 method for class 'prcomp' recover_inertia(x) ## S3 method for class 'prcomp' recover_coord(x) ## S3 method for class 'prcomp' recover_conference(x) ## S3 method for class 'prcomp' recover_aug_rows(x) ## S3 method for class 'prcomp' recover_aug_cols(x) ## S3 method for class 'prcomp' recover_aug_coord(x)
x |
An ordination object. |
The recovery generics recover_*()
return core model components, distribution of inertia,
supplementary elements, and intrinsic metadata; but they require methods for each model class to
tell them what these components are.
The generic as_tbl_ord()
returns its input wrapped in the 'tbl_ord'
class. Its methods determine what model classes it is allowed to wrap. It
then provides 'tbl_ord' methods with access to the recoverers and hence to
the model components.
Emily Paul
Other methods for singular value decomposition-based techniques:
methods-cancor
,
methods-correspondence
,
methods-lda
,
methods-lra
,
methods-mca
,
methods-princomp
,
methods-svd
Other models from the stats package:
methods-cancor
,
methods-cmds
,
methods-factanal
,
methods-kmeans
,
methods-lm
,
methods-princomp
# data frame of Anderson iris species measurements class(iris) head(iris) # compute scaled row-principal components of scaled measurements iris[, -5] %>% prcomp(scale = TRUE) %>% as_tbl_ord() %>% print() -> iris_pca # recover observation principal coordinates and measurement standard coordinates head(get_rows(iris_pca)) get_cols(iris_pca) # augment measurements with names and scaling parameters (iris_pca <- augment_ord(iris_pca))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.