Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Loading openVA using R and RScript #32

Open
rrwen opened this issue Jul 26, 2023 · 5 comments
Open

Error: Loading openVA using R and RScript #32

rrwen opened this issue Jul 26, 2023 · 5 comments

Comments

@rrwen
Copy link

rrwen commented Jul 26, 2023

When I load openVA using R in a command line terminal, the R session is immediately killed.

Working Example (Expected Behaviour)

This will work in RStudio without any problems, loading the openVA package.

library(openVA)

Not Working Example (Unexpected Behaviour)

However, in a terminal, this will not work:

R -e "library(openVA)"

Neither will this (assuming the contents of run.R only has library(openVA) on the first line:

RScript run.R

In all cases above, a message stating killed R will occur immediately.

Suspicion

It seems like InSilicoVA is the culprit, as the following does work:

R -e "library(InterVA4)"
R -e "library(InterVA5)"
R -e "library(Tariff)"

But this does not:

R -e "library(InSilicoVA)"

Use Case

I am hoping to run scheduled CRON jobs to code VA records in a scheduled manner - thus needing to run openVA via the Rscript or R commands in the terminal.

System Specs

  • Mac OS Ventura 13.4.1 (c)
  • Apple M1
  • 16 GB RAM
  • 256GB SSD
  • R v4.3.1
    • openVA 1.1.1
      • InSilicova v1.4.0
      • InterVA4 v1.7.6
      • InterVA5 v1.1.3
      • Tariff v1.0.5
      • nbc4va (not installed)
@rrwen rrwen changed the title Loading openVA using R and RScript Error: Loading openVA using R and RScript Jul 26, 2023
@richardli
Copy link
Collaborator

All the commands work for me on both an M1 and M2 mac that I have, with R 4.2.1 and 4.3.0. So I cannot reproduce the error.

If the issue is with InSilicoVA, maybe check if you can run R -e "library(rJava)" in case the issue you experience is with rJava package. Otherwise it might be a issue with your system setup.

@rrwen
Copy link
Author

rrwen commented Jul 29, 2023

Thanks for looking into this!

Looks like R -e "library(rJava)" does produce the same error Killed: 9 - maybe it is my Java version or the way I installed Java.

Do you remember which version of java you have and how you installed it? I usually use brew to install on Mac

@richardli
Copy link
Collaborator

I have the following:

% java -version
java version "17.0.2" 2022-01-18 LTS
Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)

Setting up R with Java sometimes require a bit of manual fiddling with the system set up. I don't think I did anything more complicated than R CMD javareconf on the fresh mac...but I would probably go try if someone has the same issue in the rJava package's github repo...

@rrwen
Copy link
Author

rrwen commented Aug 2, 2023

Update - I have a different java version installed with Homebrew:

% java --version
openjdk 20.0.1 2023-04-18
OpenJDK Runtime Environment Homebrew (build 20.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 20.0.1, mixed mode, sharing)

I will try a different version of java and see if this still occurs.

@rrwen
Copy link
Author

rrwen commented Aug 9, 2023

I retried with OpenJDK 17 install using Homebrew (brew install openjdk@17 and ran R CMD javareconf), but the error still occurs - so it looks like it may not be a version issue

I will look into the rJava package's repo for more clues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants