Learn R Programming

pliman (version 3.1.0)

entropy: Compute Shannon Entropy

Description

This function calculates the Shannon entropy of a numeric vector.

Usage

entropy(x)

Value

A numeric value representing the entropy.

Arguments

x

A numeric vector containing the values for which entropy will be computed.

Examples

Run this code
library(pliman)
x <- c(1, 2, 2, 3, 3, 3, 4, 4, 4, 4)
entropy(x)

Run the code above in your browser using DataLab