inst/examples/ex_shannon_entropy.R

d <- Dist(c(1, 1, 1, 1))
shannon_entropy(d)          # 2.0
shannon_entropy(d, 4)       # 1.0

d <- Dist(c(2, 1))
shannon_entropy(d)          # 0.9182958
shannon_entropy(d, b = 3)   # 0.5793802

Try the rinform package in your browser

Any scripts or data that you put into this service are public.

rinform documentation built on April 1, 2018, 12:12 p.m.