Learn R Programming

mlf (version 1.2.1)

entropy: Entropy

Description

Estimates uncertainty in univariate probability distribution.

Usage

entropy(x, bins)

Arguments

x

numeric or discrete data vector

bins

specify number of bins if numeric or integer data class.

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab