get_eigentraits: Calculate eigentraits

Description Usage Arguments Details Value Examples

View source: R/get_eigentraits.R

Description

This function uses singular value decomposition (SVD) to calculate eigentraits from the phenotype matrix in the cape data object. It adds the eigentrait matrix to the data object along with the singular values and the right singular vectors.

Usage

1
get_eigentraits(data_obj, scale_pheno = TRUE, normalize_pheno = TRUE)

Arguments

data_obj

a Cape object

scale_pheno

A logical value indicating whether to mean-center and standardize the traits.

normalize_pheno

A logical value indicating whether to rankZ normalize the phenotypes.

Details

If scale_pheno is TRUE, the phenotypes are mean-centered and standardized before running the svd.

Because we use SVD in this step, there can be no missing values in the phenotype matrix. Any individuals with missing values are removed with a message.

Value

Returns the data object with the eigentraits, singular values, and right singular vectors added.

Examples

1
2
3
4
## Not run: 
data_obj <- get_eigentraits(data_obj)

## End(Not run)

cape documentation built on Feb. 10, 2021, 5:06 p.m.