entropy {mlf} | R Documentation |
Estimates uncertainty in univariate probability distribution.
entropy(x, bins)
x |
numeric or discrete data vector |
bins |
specify number of bins if numeric or integer data class. |
# Sample numeric vector
a <- rnorm(25, 80, 35)
mlf::entropy(a, bins = 2)
# Sample discrete vector
b <- as.factor(c(1,1,1,2))
mlf::entropy(b)