I would like to use the wordcloud2 function in R on my dataset. The demo works nice:
But my dataset centers the small text in the middle. Any ideas/suggestions (includning other R libraries) welcomed:)
Thank you very much Vladimir Vinarsky The curious Mechanobiologist
I expected my higherst frequency words in the middle, not in the edges. Tried to
- manipulate the frequencies distribution by squaring it or making a power of 3
- tried more shapes
Words at the top of your data frame are plotted centrally; those at the bottom are plotted peripherally, so if you want the big words in the middle, sort your data frame accordingly.
For example, let's generate a data frame of computing terms with a random frequency column:
If I plot without ordering at all, I get a fairly random distribution of sizes throughout the cloud:
If I sort from small to large, I can replicate your issue with the smaller words appearing in the middle of the image:
If I sort in reverse order, I get the desired output, with the larger words drawn in the middle before smaller words are added around and between the larger words: