我想使用NGramTokenizer
中的RWeka
但由于某种原因我收到此错误:
我需要以下功能
BigramTokenizer <- function(x) NGramTokenizer(x, Weka_control(min = 2, max = 2))
bigramWords.dtm <- DocumentTermMatrix(Corpus(VectorSource(SentenceVector)), control = list(tokenize = BigramTokenizer))
所以我安装了RWeka:
package ‘RWekajars’ successfully unpacked and MD5 sums checked
package ‘RWeka’ successfully unpacked and MD5 sums checked
可是:
> library(RWeka)
Error : package ‘methods’ does not have a namespace
Error: package or namespace load failed for ‘RWeka’
我也会在安装包之前遇到命名空间错误:
install.packages("dplyr")
Installing package into ‘C:/Users/SomeUser/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘methods’ is not available
also installing the dependencies ‘assertthat’, ‘BH’