R/word_cloud.R

Defines functions getWordCloud

Documented in getWordCloud

#' getWordCloud
#' @title Get Word Cloud
#' @description Get word cloud for given table of words' frequencies
#' @param d table of word's frequency
#' @importFrom wordcloud wordcloud
#' @import RColorBrewer
#' @return Word cloud plot
#' @export
#' @examplesIf interactive()
#' x <- getFeqTable("Hello! R is Great")
#' getWordCloud(x)
getWordCloud <- function(d) {
  wordcloud::wordcloud(words = d$word, freq = d$freq, min.freq = 1,
                       max.words = 200, random.order = FALSE, rot.per = 0.35,
                       colors = RColorBrewer::brewer.pal(8, "Dark2"))
}

Try the shinyr package in your browser

Any scripts or data that you put into this service are public.

shinyr documentation built on April 4, 2025, 1:50 a.m.