get_word_counts: Generate word counts

get_word_countsR Documentation

Generate word counts

Description

Generate word counts

Usage

get_word_counts(
  df,
  column,
  sentiments = NULL,
  exclude_words = "",
  min_count = 1
)

Arguments

df

A data.frame

column

A column name as a string

sentiments

An optional data.frame of sentiments from tidytext::get_sentiments("bing")

exclude_words

An optional vector of words to exclude from the counts. Stop words (e.g. and, but, or) are handled automatically.

min_count

The minimum word frequency to include in the final counts. Useful for pruning wordclouds.

Value

A data.frame of word counts, optionally by sentiment


matthewjrogers/mrtools documentation built on Dec. 1, 2022, 12:11 p.m.