geom_wordcloud : is this a pipe dream

后端 未结 2 1453
猫巷女王i
猫巷女王i 2021-02-18 22:36

I deal a bit with textual data across various grouping variables. I\'m thinking of creating a method to make faceted wordcloud plots using Ian Fellows\' wordcloud

相关标签:
2条回答
  • 2021-02-18 23:09

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

    0 讨论(0)
  • 2021-02-18 23:27

    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 ;-)

    0 讨论(0)
提交回复
热议问题