Skip to contents

Produces a styled gt table of variable loadings on each principal component, with a diverging colour scale to highlight strong loadings.

Usage

tl_table_loadings(model, n_components = NULL, digits = 3, ...)

Arguments

model

A tidylearn PCA model object

n_components

Number of components to show (default: all)

digits

Number of decimal places (default: 3)

...

Additional arguments (currently unused)

Value

A gt table object.

Examples

# \donttest{
model <- tl_model(iris[, 1:4], method = "pca")
tl_table_loadings(model)
PCA Loadings
Variable PC1 PC2 PC3 PC4
Sepal.Length 0.521 −0.377 0.720 0.261
Sepal.Width −0.269 −0.923 −0.244 −0.124
Petal.Length 0.580 −0.024 −0.142 −0.801
Petal.Width 0.565 −0.067 −0.634 0.524
tidylearn | pca | n = 150
# }