pca_var: Compute variance explained by first PCA axis

Description Usage Arguments Details Examples

View source: R/PCA.R

Description

[Experimental] Compute variance explained by a few PCA axis.

Usage

1
pca_var(x, naxe = 10)

Arguments

x

glPCA object

naxe

number of axis for which you want to know explained variance

Details

PCA from glPca from the package Adegenet

Examples

1
2
3
4
5
6
7
## simulate a toy dataset
x <- adegenet::glSim(50,4e3, 50, ploidy=2)
## perform PCA
pca1 <- adegenet::glPca(x, nf=3)
## Extract variance
res <- pca_var(pca1, naxe=3)
res

biodray/QuickPop documentation built on Dec. 19, 2021, 9:44 a.m.