我需要创建包含组合词的词云。在此链接中Making a wordcloud, but with combined words?
我找到了应该使用quanteda
库的响应。我安装了它,但是当我开始调整上面链接中提出的代码时:
# detect the collocations
colls <- collocations(docs, n = 200, size = 2)
程序返回此错误:
搭配错误(docs,n = 1500,size = 2):找不到 功能&#34;搭配&#34;
根据https://www.rdocumentation.org/packages/quanteda/versions/0.9.6-9/topics/collocations
,这真的很奇怪 docs
应该是Corpus
对象,就是这样:
> class(docs)
[1] "SimpleCorpus" "Corpus"
你怎么看?
谢谢你的建议!
答案 0 :(得分:0)
你的图书馆()你的包吗? 如果你不这样做,试试
library("quanteda")
答案 1 :(得分:0)
textstat_collocations
是该软件包的唯一功能,与您正在寻找的类似:
colls <- textstat_collocations(docs, n = 200, size = 2)
我认为他们只是改变了它的名字。正如您在文档中看到的那样:
https://cran.r-project.org/web/packages/quanteda/quanteda.pdf
只有textstat_collocations
个功能。