add_pcs: Add PCA Loadings

View source: R/dim_reduction.R

add_pcsR Documentation

Add PCA Loadings

Description

Add Principal Components Analysis Loadings to a tidy or triple omics dataset.

Usage

add_pcs(
  tomic,
  value_var = NULL,
  center_rows = TRUE,
  npcs = NULL,
  missing_val_method = "drop_samples",
  label_percent_varex = TRUE,
  verbose = TRUE
)

Arguments

tomic

Either a tidy_omic or triple_omic object

value_var

An abundance value to use with hclust

center_rows

center rows before performing PCA

npcs

number of principal component loadings to add to samples (default is number of samples)

missing_val_method

Approach to remove missing values:

drop_features

Drop features with missing values

drop_samples

Drop samples which are missing all features, then drop features

impute

Impute missing values

label_percent_varex

If true then PCs will be labelled by the percent of variability they explain.

verbose

extra reporting messages

Value

A tomic object with principal components added to samples.

Examples

add_pcs(brauer_2008_triple, npcs = 5)


romic documentation built on Sept. 21, 2023, 9:06 a.m.