powered by
This function calculates the Shannon entropy of a numeric vector.
entropy(x)
A numeric value representing the entropy.
A numeric vector containing the values for which entropy will be computed.
library(pliman) x <- c(1, 2, 2, 3, 3, 3, 4, 4, 4, 4) entropy(x)
Run the code above in your browser using DataLab