我想在 R 中创建一个单词云,其中的单词在图片的形状内。一个常见的例子是使用 Twitter 鸟形状,如Wordcloud 中所示的特定形状。
尽管我遵循了多个教程,但我的代码总是导致空白表。没有形状的标准可视化效果很好。
library(wordcloud2)
library(RColorBrewer)
wordcloud2(demoFreq, size = 0.7, shape = 'star') # -> this works fine
#put picture in current working directory
getwd() #get current working directory
wordcloud2(demoFreq, figPath="heart.png", size = 1.5, color = "skyblue", backgroundColor="black") # -> this does not show anything