ShannonEntropy <- function(p, normalize = FALSE){
if (normalize){
p <- p / sum(p)
}
s <- p * log2(1 / p)
return(sum(s))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.