Wordcloud with a specific shape [closed]

☆樱花仙子☆ 提交于 2019-12-03 07:52:20

问题


Suppose, I have a dataframe which contains some words with their frequencies. I want to create a wordcloud in R with the words inside the shape of a logo, for example, the twitter logo just like this:


回答1:


You can use wordcloud2 package for that. It allows you to use any image as the mask. Just put in the working directory and link to it using figpath. Below is the code I used to make the wordcloud. Below that is the wordcloud. Here is the image I used as the mask.

library(wordcloud2)
wordcloud2(demoFreq, figPath = "twitter.jpg")



来源:https://stackoverflow.com/questions/42028462/wordcloud-with-a-specific-shape

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