Learn R Programming

hierfstat (version 0.04-22)

indpca: PCA on a matrix of individuals genotypes frequencies

Description

Carry out a PCA on the centered matrix of individual's allele frequencies.

Usage

indpca(dat,ind.labels=NULL)

# S3 method for indpca print(x,...) # S3 method for indpca plot(x,eigen=FALSE,ax1=1,ax2=2,...)

Arguments

dat

A data frame with population of origin as first column, and genotypes in following columns.

ind.labels

a vector of labels for the different individuals

x

an indpca object

eigen

whteher to plot in an additional windows screeplot of the inertias for the different axes

ax1

which PCA coordinates to plot on the x axis

ax2

which PCA coordinates to plot on the y axis

...

further arguments to pass to print or plot

Value

An object of class indpca with components

call

The function call

ipca

an object of class pca and dudi (see dudi.pca) in package ade4

mati

the original non centered matrice of individuals X alleles frequencies

Examples

Run this code
# NOT RUN {
##not run
data(gtrunchier)
x<-indpca(gtrunchier[,-2],ind.labels=gtrunchier[,2])
plot(x,col=gtrunchier[,1],cex=0.7)
# }

Run the code above in your browser using DataLab