1

I am getting the following error when I try to load a library in R using Rscript.

When I run

Rscript -e "library(coexpp)"

I get the following error

Error in x$.self$finalize() : expecting an external pointer

I am able to load the library, however, inside R interactively.

Veera
  • 861
  • 1
  • 9
  • 18
  • You may need to set an environment variable pointing to your ../Resources/library/ – IRTFM May 22 '18 at 22:59
  • .libPaths() is same in both cases – Veera May 22 '18 at 23:03
  • 1
    1. When you use R interactively, what is the version? And when you use it with Rscript, is the same version used? 2. Does loading WGCNA work, and does the error persist when you load that package before you load `coexpp`? – coffeinjunky May 22 '18 at 23:29
  • This is a duplicate -- you need to _manually_ add `library(methods)` as `Rscript` would not load this by default -- this has finally been changed in R, but not yet in the version you run. Another existing answer of mine showing that is [this one](https://stackoverflow.com/questions/34297634/cv-glmnet-works-in-rstudio-but-not-rscript/34297635#34297635). There are more. – Dirk Eddelbuettel May 23 '18 at 01:17
  • `library(methods)` didn't help. Still the same error. – Veera May 23 '18 at 15:17
  • 1
    `R CMD BATCH` as suggested in the linked question, works. Thanks – Veera May 23 '18 at 15:36

0 Answers0