R/metrics.R
shannon_entropy.Rd
Calculates Shannon entropy from a vector of counts or abundances.
shannon_entropy(x)
Numeric vector of counts or abundances.
Shannon entropy.
shannon_entropy(c(10, 5, 1)) #> [1] 1.198192