rJava在.jcall中给出了NullPointerException

时间:2016-08-03 09:30:58

标签: r rjava mallet

我正在尝试在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错误。我的sysinfo如下:

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上的表现不佳

1 个答案:

答案 0 :(得分:3)

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

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