R/Hj.r

Defines functions Hj

Hj<-function(p){

#Variables
#------------------------------------------------------------------------------------------------------------------------------
# Input:
#           p <- Dest.calc(), Gst.est.calc()
#------------------------------------------------------------------------------------------------------------------------------  

          # A function to calculate the mean heterozygosity within a subpopulation.
          # The argument p has to be a vector containing the allelefrequencies.
                1-
                  sum(p^2)
                }
          
          # See: Jost L. (2008). Gst and its relatives do not measure differentiation. 
          # Molecular Ecology 17,4015-4026.

Try the DEMEtics package in your browser

Any scripts or data that you put into this service are public.

DEMEtics documentation built on May 1, 2019, 10:09 p.m.