entropy | R Documentation |
Calculates the entropy of a category. It uses the amount of categories to scale between 0 and 1.
entropy(x)
x |
A character or vector with two or more categories |
The numeric value of the Shannon entropy scaled between 0 and 1.
It omits the NA
if present.
entropy(c("H", "T", "H", "T"))
entropy(c("H", "T", "H", "T", "H", "H", "H"))
entropy(c("H", "T", "H", "T", "H", "H", NA))
entropy(c("H", "T", "H", "T", "H", "H"))
entropy(c("H", "H", "H", "H", "H", "H", NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.