Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

feature_stats

Feature statistics


Description

Compute a number of useful statistics for features: term frequency, idf, etc.

Usage

feature_stats(tc, feature, context_level = c("document", "sentence"))

Arguments

tc

a tCorpus

feature

The name of the feature column

context_level

Should results be returned at document or sentence level

Value

a data.frame

Examples

tc = create_tcorpus(c('Text one first sentence. Text one second sentence', 'Text two'),
                    split_sentences = TRUE)


fs = feature_stats(tc, 'token')
head(fs)
fs = feature_stats(tc, 'token', context_level = 'sentence')
head(fs)

corpustools

Managing, Querying and Analyzing Tokenized Text

v0.4.10
GPL-3
Authors
Kasper Welbers and Wouter van Atteveldt
Initial release
2022-05-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.