Learn R Programming

dlookr (version 0.6.3)

entropy: Calculate the entropy

Description

Calculate the Shannon's entropy.

Usage

entropy(x)

Value

numeric. entropy

Arguments

x

a numeric vector.

Examples

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

entropy(x)

Run the code above in your browser using DataLab