rJava gives a NullPointerException in .jcall - r

I am trying to run a standard corpus loading method in the mallet R package and more specifically
instance <- mallet.import(names(txt$CELEX), txt$TEXT, stoplist.file = "stopwords.en.txt", token.regexp = "\\p{L}[\\p{L}\\p{P}]+\\p{L}")
Then I get the following error
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.lang.NullPointerException
which seems to me more like an rJava error more than anything else. My sysinfo follows:
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
I use Java 8 in case it matters. I read somewhere that rJava is not playing well with Java 8

That's not the usual error from rJava problems, which seem to have settled down.
One possible problem could be that the stoplist file does not exist or is not in the right place.

Related

Error message when opening Rstudio "evaluation nested too deeply"

When I open Rstudio I get this error message in my console
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
It happens when I open any script or Rproject. I couldn't find any info on this error and how to address it. I've tried uninstalling R and installing it again but the problem persists. Any ideas on how to solve this?
Here is my session Info
> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] geobr_1.2.1
loaded via a namespace (and not attached):
[1] compiler_3.6.2 magrittr_1.5 class_7.3-15
[4] DBI_1.1.0 tools_3.6.2 units_0.6-5
[7] Rcpp_1.0.3 KernSmooth_2.23-16 grid_3.6.2
[10] e1071_1.7-3 classInt_0.4-2 sf_0.8-0

RBioFormats library needs internet connection to load

I'm using RBioFormats for image processing purposes with R. I'm not able to load RBioFormats library when my computer has not internet connection.
R's console throught the error message:
Error: package or namespace load failed for 'RbioFormats':
.onLoad failed in loadNamespace() for 'RBioFormats', details:
call: NULL
error: failed to download Bio-Formats Java library
Check your internet connection
I'm using GNU/Linux OS. Firstly, I thought it was due to the version 11 of java environment installed. I've noticed the v11 is a develper version. After installing java environment v8, result in the same error output. The result is that I cannot use RBioFormats library when I have not internet connection.
> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Anarchy Linux
Matrix products: default
BLAS: /usr/lib/libblas.so.3.8.0
LAPACK: /usr/lib/liblapack.so.3.8.0
locale:
[1] LC_CTYPE=es_ES.UTF-8 LC_NUMERIC=C LC_TIME=es_ES.UTF-8 LC_COLLATE=es_ES.UTF-8 LC_MONETARY=es_ES.UTF-8
[6] LC_MESSAGES=es_ES.UTF-8 LC_PAPER=es_ES.UTF-8 LC_NAME=es_ES.UTF-8 LC_ADDRESS=es_ES.UTF-8 LC_TELEPHONE=es_ES.UTF-8
[11] LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=es_ES.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RBioFormats_0.0.54 rJava_0.9-11
loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 locfit_1.5-9.1 lattice_0.20-38 png_0.1-7 fftwtools_0.9-8 digest_0.6.19 bitops_1.0-6 tiff_0.1-5
[9] grid_3.6.0 EBImage_4.26.0 tools_3.6.0 htmlwidgets_1.3 RCurl_1.95-4.12 jpeg_0.1-8 abind_1.4-5 parallel_3.6.0
[17] compiler_3.6.0 BiocGenerics_0.30.0 htmltools_0.3.6
Since RBioFormats version 0.057, is not required Internet connection on startup anymore. Link to commit

Error while trying to use 'ez' library

I've error while trying to call ez library for rAnova, the issue that I cannot found pbkrtest package while I executed with success install.packages("ez"). library(ez) return to me the following error :
Error in loadNamespace (j <- i [[1L]], c (lib.loc, .libPaths ()) = vI VERSIONCHECK [[j]]): no package named 'pbkrtest' is found
In addition: Warning message: package 'ez' was compiled with version 3.2.5 R Error: loading the package or namespace failed for 'ez'
How can I properly use this library ? Thanks
EDIT : Sessioninfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)
locale:
[1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252
[3] LC_MONETARY=French_France.1252 LC_NUMERIC=C
[5] LC_TIME=French_France.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_1.12.0
loaded via a namespace (and not attached):
Error in x[["Version"]] : index out of limits
De plus : Warning messages:
1: In FUN(X[[i]], ...) :
The file DESCRIPTION of the package 'digest' is missing or incorrect
2: In FUN(X[[i]], ...) :
The file DESCRIPTION of the package 'nlme' is missing or incorrect
EDIT 2: Sessioninfo() after restarting machine and R
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)
locale:
[1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252
[3] LC_MONETARY=French_France.1252 LC_NUMERIC=C
[5] LC_TIME=French_France.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] MASS_7.3-45 Matrix_1.2-7.1 tools_3.2.2 mgcv_1.8-15
[5] nnet_7.3-12 nlme_3.1-121 grid_3.2.2 lattice_0.20-34
but still the same error (above) when tape library(ez).
So it seems that was a question of R version. As noticed in the error and as I understood 'ez' was compiled with version 3.2.5 R. So now i'm under 3.3.1 and I intalled EZ with success and can load the library and use the function. The more complicated is to reinstall R and all packages that seems painful, but thanks to this great post that allow me to store all my packages in a temp folder and to reinstall them in the newest version
For information if it could help someone else, my Sessioninfo() returns :
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8.1 x64 (build 9600)
locale:
[1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252 LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C LC_TIME=French_France.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ez_4.3
loaded via a namespace (and not attached):
[1] Rcpp_0.12.7 magrittr_1.5 splines_3.3.1 MASS_7.3-45 munsell_0.4.3
[6] colorspace_1.2-6 lattice_0.20-33 minqa_1.2.4 stringr_1.1.0 car_2.1-3
[11] plyr_1.8.4 tools_3.3.1 nnet_7.3-12 parallel_3.3.1 pbkrtest_0.4-6
[16] grid_3.3.1 nlme_3.1-128 gtable_0.2.0 mgcv_1.8-12 quantreg_5.29
[21] MatrixModels_0.4-1 lme4_1.1-12 Matrix_1.2-6 nloptr_1.0.4 reshape2_1.4.1
[26] ggplot2_2.1.0 stringi_1.1.2 scales_0.4.0 SparseM_1.72
>

Ctrl + Shift + D doesn't run documentation routines

According to the shortcuts help (Alt+Shift+K) the combination Ctrl+Shift+D should run the documentation routines. (This is also said in Section 5.1 of Hadley Wickhams "R packages" http://runsheng.github.io/attachment/r-packages.pdf.) But in my RStudio-setting, it doublicates the selected row (so I don't belive it is a global usage problem brought up in the answers here: Visual Studio won't recognize key combination). On https://support.rstudio.com/hc/en-us/community/posts/201819358-Ctrl-Shift-D-doesn-t-run-document-in-preview-release the issue was brought up by someone, but without a solution. How can I make RStudio do what it should do?
I'm using RStudio version 0.99.902 and sessionInfo() gives:
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] hmi_0.1.0 roxygen2_5.0.1 coda_0.18-1 MASS_7.3-45 devtools_1.12.0
loaded via a namespace (and not attached):
[1] magrittr_1.5 tools_3.3.1 withr_1.0.2 rstudioapi_0.6 Rcpp_0.12.5
[6] memoise_1.0.0 stringi_1.1.1 grid_3.3.1 stringr_1.0.0 digest_0.6.9
[11] lattice_0.20-33
Can you double check what these options are set to in Project Options?
You might need to ensure that both
Use devtools package functions in available
Generate documentation with Roxygen
are both checked.

How can I start Rselenium in Mac?

I am trying to run this simple code.
library("RSelenium")
checkForServer()
startServer() #Default server
remDr <- remoteDriver$new()
remDr$open(silent = TRUE) #Opens a browser
But I am getting this error:
Error: Summary: UnknownError
Detail: An unknown server-side error occurred while processing the command.
class: org.openqa.selenium.WebDriverException
How can I fix this?
Diagnosis
sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.3 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RSelenium_1.3.5 XML_3.98-1.3 RJSONIO_1.3-0 RCurl_1.95-4.7 bitops_1.0-6 dplyr_0.4.3
[7] rvest_0.3.1 xml2_0.1.2
loaded via a namespace (and not attached):
[1] Rcpp_0.12.3 assertthat_0.1 R6_2.1.2 DBI_0.3.1 magrittr_1.5
[6] httr_1.1.0 curl_0.9.6 tools_3.2.3 parallel_3.2.3 rsconnect_0.4.1.11
[11] caTools_1.17.1
system("java -version")
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

Resources