powered by
This function calculates the entropy of a system with discrete states
diversity(x, prior = NULL)
numeric vector, observed probabilities of the classes
numeric vector, the prior probabilities of the classes
the entropy or diversity measure
# NOT RUN { x <- c(0.4, 0.6) diversity(x) # }
Run the code above in your browser using DataLab