fst: Generic function to calculate Fst

Usage Arguments Value Examples

View source: R/fst.R

Usage

1
fst(N)

Arguments

N

A 2-D array. It gives the number of individuals of each genotype (first dimension) in each group (second dimension)

Value

This function calculates the genetic differentiation index Fst among the groups contained in N as ratio of heterozygosities: (Ht - Hs) / Ht. Ht is the expected heterozygosity over the population formed by pooling the groups together. Hs is the average expected heterozygosity over the groups. The average is weighted by the number of individuals in each group.

Examples

1
2
3
4
5
6
7
# Data: three groups with two alleles
# Genotypic composition of first, second and third groups
N1 <- c(18,299,277)
N2 <- c(284,14,145)
N3 <- c(115,228,254)
N <- array(c(N1,N2,N3),dim=c(3,3),dimnames=list(genotype=c("A1A1","A1A2","A2A2"),group=c(1:3)))
fst(N)

MarcoAndrello/MetaPopGen_0.0.8 documentation built on May 25, 2019, 12:23 p.m.