Learn R Programming

stylest2 (version 0.1)

stylest2_terms: Select terms above frequency cutoff

Description

A function to select terms for inclusion in a stylest2 model, based on a document-feature matrix of texts to predict and a specified cutoff.

Usage

stylest2_terms(dfm, cutoff)

Value

A character vector of terms falling above the term frequency cutoff.

Arguments

dfm

a quanteda dfm object.

cutoff

a single numeric value - the quantile of term frequency under which to drop terms.

Examples

Run this code
data(novels_dfm)
best_cut <- stylest2_select_vocab(dfm=novels_dfm)
stylest2_terms(dfm = novels_dfm, cutoff=best_cut$cutoff_pct_best)

Run the code above in your browser using DataLab