Learn R Programming

quanteda (version 1.5.2)

textstat_entropy: Compute entropy of documents or features

Description

Compute entropy of documents or features

Usage

textstat_entropy(x, margin = c("documents", "features"), base = 2)

Arguments

x

a dfm

margin

character indicating for which margin to compute entropy

base

base for logarithm function

Examples

Run this code
# NOT RUN {
textstat_entropy(data_dfm_lbgexample)
textstat_entropy(data_dfm_lbgexample, "features")
# }

Run the code above in your browser using DataLab