rJava 在 .jcall 中给出 NullPointerException

rJava gives a NullPointerException in .jcall

我正在尝试 运行 mallet R 包中的标准语料库加载方法,更具体地说

instance <- mallet.import(names(txt$CELEX), txt$TEXT, stoplist.file = "stopwords.en.txt", token.regexp = "\p{L}[\p{L}\p{P}]+\p{L}")

然后我得到以下错误

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
java.lang.NullPointerException

在我看来,这更像是一个 rJava 错误。我的系统信息如下:

R version 3.3.0 (2016-05-03)

Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=Danish_Denmark.1252  LC_CTYPE=Danish_Denmark.1252    LC_MONETARY=Danish_Denmark.1252
[4] LC_NUMERIC=C                    LC_TIME=Danish_Denmark.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] mallet_1.0           XLConnect_0.2-12     XLConnectJars_0.2-12 quanteda_0.9.6-9     rJava_0.9-8         
[6] topicmodels_0.2-4   

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.5       lattice_0.20-33   slam_0.1-35       chron_2.3-47      grid_3.3.0        stats4_3.3.0     
 [7] stringi_1.1.1     data.table_1.9.6  NLP_0.1-9         ca_0.64           Matrix_1.2-6      tools_3.3.0      
[13] parallel_3.3.0    tm_0.6-2          modeltools_0.2-21

我使用 Java 8 以防万一。我在某处读到 rJava 与 Java 8

的配合不佳

这不是 rJava 问题的常见错误,它似乎已经解决了。

一个可能的问题是停止列表文件不存在或不在正确的位置。