【发布时间】:2017-11-07 12:43:07
【问题描述】:
在tydy-text这本书之后获得n-gram:http://tidytextmining.com/ngrams.html
代码:
library(tidyr)
bigrams_separated <- austen_bigrams %>%
separate(bigram, c("word1", "word2"), sep = " ")
bigrams_filtered <- bigrams_separated %>%
filter(!word1 %in% stop_words$word) %>%
filter(!word2 %in% stop_words$word)
# new bigram counts:
bigram_counts <- bigrams_filtered %>%
count(word1, word2, sort = TRUE)
我收到一个错误:
Warning: Error in : 'sep' is not an exported object from 'namespace:dplyr'
【问题讨论】:
-
我已经检查了链接中的一段代码以及您粘贴的代码,一切正常。我用:
R version 3.4.1 (2017-06-30)你试过更新包还是Renv? -
是的,更新了软件包并重启了 Rstudio 服务器
-
这很奇怪;不幸的是,我无法重现它。你说你在 RStudio Server 的一个实例上。你知道你用的是什么版本吗?