word_frequencies: Return top n word frequencies in a collection of text...

Description Usage Arguments See Also Examples

Description

Splits the text verbatim into words, count the number of words. Either plots or returns the top n words in a collection of text documents.

Usage

1
2
word_frequencies(df, text_col, number_of_words = 1, plot = TRUE,
  number_of_words_to_plot = 10, clean_text = FALSE)

Arguments

df

a tidy dataframe/tribble.

text_col

the name of the text column within df

number_of_words

return a plot/df of single, bigram or trigrams? returns single words by default

plot

return a ggplot2? TRUE by default

number_of_words_to_plot

how many words/terms to plot? Plots Top 10 words in a collection of text documents by default.

clean_text

pre-process text? FALSE by default. Lammatizes and get rid of extra spaces before and words before counting

See Also

word_frequencies_by_category

Examples

1
2
3
4
5
6
7
## Not run: 
data("text_data")
word_frequencies(verbatim,text_col = text)
word_frequencies(verbatim,text_col = text,number_of_words = 2,clean_text = TRUE)
word_frequencies(verbatim,text_col = text,number_of_words = 3)

## End(Not run)

fahadshery/textsummary documentation built on May 6, 2019, 7:02 p.m.