entropy: Computes Shannon Entropy

Description Usage Arguments Examples

View source: R/entropy.R

Description

Note: this package is deprecated. Please use languageEntropy::entropy instead. Given a vector of discrete probabilities, this function will output the Shannon Entropy (a measure of uncertainty)

Usage

1
entropy(x, base = 2)

Arguments

x

A vector of discrete probabilities

base

Base of the logarithm. Shannon Entropy uses base 2. Other common bases are e (natural) and 10 (hartley).

Examples

1
2
prob_table <- data.frame(event=c("A","B"), prob=c(.25,.75))
entropy(prob_table$prob)

jasongullifer/convenience documentation built on May 21, 2019, 10:31 a.m.