Nothing
entropy <- function(P) {
if (is.null(dim(P))) { # Vector input
p <- P
p_nonzero <- p[p > 0]
return(-sum(p_nonzero * log2(p_nonzero)))
} else { # Matrix input
H <- apply(P, 2, function(col) {
p_nonzero <- col[col > 0]
-sum(p_nonzero * log2(p_nonzero))
})
return(H)
}
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.