Description Usage Arguments Value Examples
The Shannon entropy estimates the average minimum number of bits needed to encode a string of symbols, based on the frequency of the symbols (see http://www.bearcave.com/misl/misl_tech/wavelets/compression/shannon.html).
1 2 3 | shannon_entropy(x)
H(x)
|
x |
A factor as the represented categorical variable. |
Shannon entropy estimation of the categorical variable.
1 2 3 4 5 6 7 | shannon_entropy(factor(c(1,0)))
shannon_entropy(factor(c('a','b','c')))
## Not run:
shannon_entropy(1)
shannon_entropy(c('a','b','c'))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.