This function implements wordcloud that compares documents. Code is adopted
from wordcloud::comparison.cloud()
.
wordcloud_comparison(
x,
min_size,
max_size,
min_count,
max_words,
color,
font,
adjust,
rotation,
random_order,
random_color,
ordered_color,
labelcolor,
labelsize,
labeloffset,
fixed_aspect,
colors,
scale,
min.freq,
max.words,
random.order,
rot.per,
use.r.layout,
title.size,
...
)
a dfm or quanteda.textstats::textstat_keyness object
size of the smallest word
size of the largest word
words with frequency below min_count will not be plotted
maximum number of words to be plotted. The least frequent
terms dropped. The maximum frequency will be split evenly across
categories when comparison = TRUE
.
colour of words from least to most frequent
font-family of words and labels. Use default font if NULL
.
adjust sizes of words by a constant. Useful for non-English words for which R fails to obtain correct sizes.
proportion of words with 90 degree rotation
plot words in random order. If FALSE
, they will be
plotted in decreasing frequency.
choose colours randomly from the colours. If FALSE
,
the colour is chosen based on the frequency
if TRUE
, then colours are assigned to words in
order.
colour of group labels. Only used when comparison = TRUE
.
size of group labels. Only used when comparison = TRUE
.
position of group labels. Only used when
comparison = TRUE
.
logical; if TRUE
, the aspect ratio is fixed. Variable
aspect ratio only supported if rotation = 0.
deprecated argument
deprecated argument
deprecated argument
deprecated argument
deprecated argument
deprecated argument
deprecated argument
additional parameters. Only used to make it compatible with wordcloud
Kohei Watanabe, build on code from Ian Fellows's wordcloud package.