Learn R Programming

quanteda.textstats (version 0.97.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)

Value

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

Arguments

x

a dfm

margin

character indicating for which margin to compute entropy

base

base for logarithm function

Examples

Run this code
library("quanteda")
textstat_entropy(data_dfm_lbgexample)
textstat_entropy(data_dfm_lbgexample, "features")

Run the code above in your browser using DataLab