calcPCA {IDmeasurer}R Documentation

Convert raw trait variables into principal components

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

calcPCA(df)

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

summary(ANmodulation)
temp <- calcPIC(ANmodulation)
summary(temp)


[Package IDmeasurer version 1.0.0 Index]