calcPCA: Convert raw trait variables into principal components

Description Usage Arguments Value Examples

Description

This function subjects the trait variables from the original dataset to the Principal component analysis (PCA, stats:prcomp) and calculates principal componenets scores for each sample. All variables are centered by subtracting the variable mean from a particular value and scaled to the unit variance by dividing the value by the standard deviation of a trait (stats::prcomp parameters center = T, scale = T). Some functions like, for example, calcHS require uncorrelated input variables to calculate individual identity information properly.

Usage

1

Arguments

df

A data frame with the first column indicating individual identity.

Value

df A data frame with the same attributes like the df, but the original individuality traits are replaced by principal components.

Examples

1
2
3

IDmeasurer documentation built on May 9, 2019, 5:02 p.m.