R/NucleotideDiversity.R

Defines functions NucleotideDiversity

Documented in NucleotideDiversity

NucleotideDiversity <-
function(dst, w=NULL){
    ##  Nucleotide diversity 
    ##  Computed as eq 10.5 in Nei (1987) pg.256
        ##     w: vector of counts
        ##   dst: a distance object or an aquare matrix of distances
    if(is.null(w))
        w <- rep(1, nrow(as.matrix(dst)))
    return(Rao(dst, w))
}

Try the QSutils package in your browser

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

QSutils documentation built on Nov. 8, 2020, 7:42 p.m.