Learn R Programming

quanteda (version 2.1.2)

textstat_entropy: Compute entropies of documents or features

Description

Compute entropies 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

Value

a data.frame of entropies for the given document or feature

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