[Experimental] Compute variance explained by a few PCA axis

pca_scoretable(x, naxe = 1)

Arguments

x

glPCA object

naxe

number of axis for which you want to extract PCA scores

Details

PCA from glPca. It will return a dataframe, including ID and pca.score for the desire number of axis

Examples

## simulate a toy dataset x <- adegenet::glSim(50,4e3, 50, ploidy=2)
#> Registered S3 method overwritten by 'spdep': #> method from #> plot.mst ape
## perform PCA pca1 <- adegenet::glPca(x, nf=3) ## Extract variance res <- pca_scoretable(pca1, naxe=3) head(res)
#> ID score.PC1 score.PC2 score.PC3 #> 1 1 -2.897836 2.7779365 2.4728657 #> 2 2 -1.921593 -2.4625237 1.0384473 #> 3 3 -1.747774 -2.0255692 -3.0321781 #> 4 4 -2.664595 -0.6764288 1.0973202 #> 5 5 -3.242396 -1.2912680 0.5102435 #> 6 6 -2.144298 -8.5077827 0.5113998