ggwordcloud is meant as an approximate replacement for wordcloud. It has almost the same syntax but allows only the words/freqs input. As the underlying algorithms are not strictly equal, the resulting wordcloud is only similar to the ones one can obtain with wordcloud.

ggwordcloud(
  words,
  freq,
  scale = c(4, 0.5),
  min.freq = 3,
  max.words = Inf,
  random.order = TRUE,
  random.color = FALSE,
  rot.per = 0.1,
  colors = "black",
  ordered.colors = FALSE,
  ...
)

Arguments

words

the words

freq

their frequencies

scale

A vector of length 2 indicating the range of the size of the words.

min.freq

words with frequency below min.freq will not be plotted

max.words

Maximum number of words to be plotted. least frequent terms dropped

random.order

plot words in random order. If false, they will be plotted in decreasing frequency

random.color

choose colors randomly from the colors. If false, the color is chosen based on the frequency

rot.per

proportion words with 90 degree rotation

colors

color words from least to most frequent

ordered.colors

if true, then colors are assigned to words in order

...

Additional parameters to be passed to geom_text_wordcloud

Value

a ggplot

Examples

set.seed(42)
data("love_words_latin_small")

ggwordcloud(love_words_latin_small$word, love_words_latin_small$speakers)