Learn R Programming

stockR (version 1.0.76)

calcFst: Calculate Fst statistics for frequency data

Description

Calculates Weir and Cockerham's Fst for frequency data

Usage

calcFst(data, grps)

Value

A numeric matrix containing the pairwise Fst values between all populations.

Arguments

You can put normal text in Arguments, too, like this. Remember to indent all arguments, as below.

data

a nMarker by nAnimal matrix of allele frequencies. That is for animal i and codominant marker j data[j,i] is the number of copies of the SNP allele (0, 1, or 2).

grps

a numeric vector giving the populations of the nAnimals

Authors

Arnaud Estoup for original code in Turbo Pascal. Translation in Fortran and interface with R by Gilles Guillot (for Geneland package). Scott Foster for latest wrapper for stockR package.

Author

Scott D. Foster

Details

This function is really just a wrapper for the Fstat() function, taken from the (now unsupported) Geneland package.

Examples

Run this code
set.seed(717)
data <- sim.stock.data( nAnimals=50, nSNPs=500, nSampleGrps=50, K=5, ninform=50)
calcFst( data, attributes( data)$grps)

Run the code above in your browser using DataLab