2

Is there a way to make a comparison cloud with the wordcloud2 package in R. I want a wordcloud that is colored by a categorical variable in the dataset and a legend to be created on the wordcloud. This is an example in the original wordcloud package which is done using comparison.cloud():

enter image description here

realrbird
  • 31
  • 5
  • That doesn't seem to be an option. You can look at the [documentation](https://cran.r-project.org/web/packages/corpustools/corpustools.pdf) and their [vignette](https://cran.r-project.org/web/packages/wordcloud2/vignettes/wordcloud.html) but the word "comparison" does not come up anywhere. – JBGruber Apr 18 '18 at 21:39
  • Yeah, I figured it was not an option but thought maybe I was missing something. Thanks for the confirmation. – realrbird May 08 '18 at 14:10

1 Answers1

0

In wordcloud2 you can use the color argument to set a vector with the colors. In my dataset I had a column with the words, another with the frequencies and a third one with the respective color-categories.

This is what my code looked like:

wordcloud2(df, color = df$colors, size = .6, shape = "circle")