diversity {div} | R Documentation |
This function calculates the entropy of a system with discrete states
diversity(x, prior = NULL)
x |
numeric vector, observed probabilities of the classes |
prior |
numeric vector, the prior probabilities of the classes |
the entropy or diversity measure
x <- c(0.4, 0.6)
diversity(x)