compute_PCA: Compute a PCA on horn characteristics

Description Usage Arguments Value See Also Examples

View source: R/pca.R

Description

This function computes a Principal Component Analysis (PCA) on male horn measurements using prcomp. The PCA is computed on the centered and scaled variables.

Usage

1

Arguments

data

A dataframe containing the data to be processed.

Value

A list providing the original data with the first 2 principal components added to it, the proportion of variance explained by each component, the cummulated proportion of variance explained by each component, and the PCA object as returned by prcomp.

See Also

plot_PCA figure_PCA

Examples

1
2
PCA_C1_males <- compute_PCA(males[males$Cohort == 'C1', ])
PCA_C2_males <- compute_PCA(males[males$Cohort == 'C2', ])

courtiol/matingRhinos documentation built on Nov. 22, 2019, 11:10 p.m.