R/tm_freq.R
tm_freq.RdGenerate a circular bar plot with frequency of words / ngrams.
This function is used within meeting_tm_report().
tm_freq(data, token = "words", stopwords = NULL, keep = 100, return = "plot")A Meeting Query dataset in the form of a data frame.
A character vector accepting either "words" or "ngram",
determining type of tokenisation to return.
A character vector OR a single-column data frame labelled
'word' containing custom stopwords to remove.
A numeric vector specifying maximum number of words to keep.
String specifying what to return. This must be one of the following strings:
"plot"
"table"
See Value for more information.
A different output is returned depending on the value passed to the return
argument:
"plot": 'ggplot' object. A circular bar plot.
"table": data frame. A summary table.
This function uses tm_clean() as the underlying data wrangling function.
There is an option to remove stopwords by passing a data frame into the
stopwords argument.
Other Text-mining:
meeting_tm_report(),
pairwise_count(),
subject_validate(),
subject_validate_report(),
tm_clean(),
tm_cooc(),
tm_wordcloud()
# \donttest{
tm_freq(mt_data, token = "words")
#> Selecting by n
#> Warning: ggrepel: 3 unlabeled data points (too many overlaps). Consider increasing max.overlaps
tm_freq(mt_data, token = "ngrams")
#> Selecting by n
#> Warning: ggrepel: 52 unlabeled data points (too many overlaps). Consider increasing max.overlaps
# }