entropy: Shannon entropy

View source: R/entropy.R

entropyR Documentation

Shannon entropy

Description

Shannon entropy

Usage

entropy(S, n = 1)

Arguments

S

character of length 1 or longer, contains the sequence

n

numeric of length 1, first- or second-order entropy (n=1 or n=2)

Details

see also the entropy function in the entropy

Value

a numeric value

Examples

S <- "AABAACA"
entropy(S, n = 1)
## Not run: 
# entropy's version only works with table counts
St <- table(unlist(strsplit(S, "")))
entropy::entropy(St, method = "ML" , unit="log2")

## End(Not run)
entropy(S, n = 2)

gobbios/cfp documentation built on April 11, 2022, 2:22 a.m.