R/FAD.R

Defines functions FAD

Documented in FAD

FAD <-
function(dst){
    ## Functional Attribute Diversity
        ##   dst: a distance object or a matrix of distances
    if(!is(dst, "dist") & !is(dst, "matrix"))
    stop("The input object must be of dist or matrix class \n")
    # Sum of all elements of the matrix
    return(sum(as.matrix(dst)))
}

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.