Learn R Programming

GrpString (version 0.3.2)

TransEntro: Transition entropy of a group of strings

Description

TransEntro computes the overall transition entropy of all the strings in a group.

Usage

TransEntro(strings.vec)

Arguments

strings.vec

String Vector.

Value

Returns a single number.

Details

Entropy is calculated using the Shannon entropy formula: -sum(freqs * log2(freqs)). Here, freqs are transition frequencies, which are the values in the normalized transition matrix exported by function TransMx in this package. The formula is equivalent to the function entropy.empirical in the 'entropy' package when unit is set to log2.

References

I. Hooge; G. Camps. (2013) Scan path entropy and arrow plots: capturing scanning behavior of multiple observers. Frontiers in Psychology.

See Also

TransEntropy, TransMx

Examples

Run this code
# NOT RUN {
# simple strings
stra.vec <- c("ABCDdefABCDa", "def123DC", "A", "123aABCD", "ACD13", "AC1ABC", "3123fe")
TransEntro(stra.vec)

# }

Run the code above in your browser using DataLab