Learn R Programming

dlookr (version 0.5.0)

entropy: Calculate the entropy

Description

Calculate the Shannon's entropy.

Usage

entropy(x)

Arguments

x

a numeric vector.

Value

numeric. entropy

Examples

Run this code
# NOT RUN {
set.seed(123)
x <- sample(1:10, 20, replace = TRUE)

entropy(x)

# }

Run the code above in your browser using DataLab