pca_ind_contrib {booklet}R Documentation

Compute individual contributions

Description

Return individual contributions for each principal component

Usage

pca_ind_contrib(
  ind_coords,
  eigs,
  weighted_row = rep(1, nrow(ind_coords))/nrow(ind_coords)
)

Arguments

ind_coords

individual coordinates

eigs

eigs computed by pca_eigen or pca_weighted_eigen

weighted_row

row weights

Details

If you want to compute the contributions of the individuals to the principal components, you have to change the weighted_col argument to rep(1, nrow(ind_cos2)).

Value

A dataframe of individual contributions.

Examples

library(booklet)

eigs <- iris[, -5] |>
  pca_standardize_norm() |>
  pca_weighted_eigen()

eigs |>
  pca_ind_coords() |>
  pca_ind_contrib(eigs) |>
  head()

[Package booklet version 1.0.0 Index]