Learn R Programming

hierfstat (version 0.5-11)

indpca: PCA on a matrix of individuals genotypes frequencies

Description

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

Usage

indpca(dat,ind.labels=NULL,scale=FALSE)

# 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

scale

whether to standardize each column to variance 1 or to leave it as is (default)

x

an indpca object

eigen

whether 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