Takes a sample-by-species abundance matrix and species-by-species functional distance matrix and returns values of Rao's quadratic entropy. Values are optionally converted into effective numbers of species through the transformation: 1/(1 - D).
# Create sample-by-species abundance matrix
abund <- matrix(sample(1:100, 100, replace = T), 10, 10)
colnames(abund) <- paste0("species", 1:10)
# Create species-by-species functional distance matrix
traits <- FD::gowdis(matrix(runif(100, 0, 1), 10, 10, dimnames = list(colnames(abund), colnames(abund))))
# Compute diversity
raoQ(abund, traits)