geom_wordcloud : is this a pipe dream

懵懂的女人 提交于 2019-12-03 22:37:00

This may be a pipe dream, and it certainly isn't easy to re-use the wordcloud code:

  1. As Ian Fellows points out in a comment, the wordcloud code calculates word sizes and positions in base graphics.
  2. A geom-aware modification of the code needs to be aware of facets.

In terms of making it work, a framework for designing a solution might be:

  1. Rewrite wordcloud to calculate word sizes in grid graphics, rather than base graphics
  2. Write the results of word size and position to a data frame
  3. Wrap the calculations in a function called stat_wordcloud
  4. Modify geom_text to a new geom_wordcloud

So, it's a pipe dream, but I'd be keen to use it once you've made it ;-)

This is a possible solution using ggplot2 style: https://github.com/lepennec/ggwordcloud

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!