Questions tagged [jri]

JRI is a Java/R Interface, which allows to run R inside Java applications as a single thread.

JRI comes bundled with rJava, so the best way is to simply install rJava. It is available from CRAN, so you can use in R:

install.packages("rJava") 

JRI uses native code, but it supports all platforms where Sun's Java (or compatible) is available, including Windows, Mac OS X, Sun and Linux (both 32-bit and 64-bit).

143 questions
10
votes
4 answers

Exporting to Runnable jar with extra native code libraries in eclipse

I am having trouble exporting my java project from eclipse as a jar executable file. My java project uses an external library (its called jri). I have exported the jri.jar file and set the library path for its native library in eclipse, and it works…
Julio Diaz
  • 9,067
  • 19
  • 55
  • 70
9
votes
1 answer

In R, how to plot into a memory buffer instead of a file?

I'm using JRI to generate ggplot2 plots from Java. Currently I have to write plots to disk. How do I do this without going through files, i.e. just rendering the plots in memory? I tried using the Cairo package to plot to a textConnection, but…
Yang
  • 16,037
  • 15
  • 100
  • 142
7
votes
1 answer

How to set environment variables in Netbeans 8.0.2?

I'm running a test class that came with my JRI (Java-R interface) package. I'm running it through NetBeans. Unfortunately, NetBeans complains about R_HOME not being set. Creating Rengine (with arguments) Rengine created, waiting for R R_HOME is not…
ktm5124
  • 11,861
  • 21
  • 74
  • 119
7
votes
2 answers

Java-R bridge "JRI" error: R is already initialized

I'm using JRI as a calculation slave for statistics from within Java. R computations are required from time to time, but not too frequently. Thus, i decided to create a wrapper method for the computation which creates a new REngine instance and also…
Chris
  • 721
  • 1
  • 10
  • 23
7
votes
5 answers

Java R Interface (JRI) Setup

I am trying to setup the Java/R interface (bundled in the R "rJava" package), but I am having some trouble (despite trying many suggestions here and on other forums). I am running Windows 7, jdk1.7.0_05, Eclipse, R 2.15.2. These are all 64 bit…
user1415528
  • 81
  • 1
  • 1
  • 6
6
votes
1 answer

How I can load a R script into JRI and execute from Java?

I'm using JRI to execute R from Java and I saw that JRI use the eval() method to execute the R commands. I have one R script for execution. How I can load this script in JRI and execute it?
Renato Dinhani
  • 35,057
  • 55
  • 139
  • 199
6
votes
1 answer

How to plot a graph using R, Java and JRI?

I am very new to R, so please pardon me if this is a very very basic question. I have written an R script, which does some calculations and at the end plots Box Plot. If I run this script from the R console, it runs fine and graph is plotted. If I…
Bhushan
  • 18,329
  • 31
  • 104
  • 137
6
votes
1 answer

Can't find dependent libraries when trying to load JRI

I have this simple piece of code that tries to load the JRI module. public static void main(String... args) { System.out.println(System.getProperty("java.library.path").toString()); System.setProperty("jri.ignore.ule", "yes"); …
Abhishek Dey Das
  • 587
  • 7
  • 23
5
votes
2 answers

How to set environment variables for R to use in Tomcat on RedHat Linux (RHEL6)

I'm trying to set up R and Tomcat on RHEL6 (6.4) I have installed R and can run it. I have installed Tomcat 7 and can host files file. I have packaged an application as a WAR file and deployed it using tomcat. The application runs fine in all…
user2203980
  • 51
  • 1
  • 3
4
votes
1 answer

Converting REXP object to a double array (Java/R)

I want R to produce, for example, normal data and then use this data in Java. I know there is a function to convert an REXP object to an array but it doesn't seem to work. Here is what I have: REXP x; x = re.eval("rnorm(100,50,10)"); double[] test =…
Aran Brady
  • 139
  • 1
  • 12
4
votes
4 answers

jri.dll: Can't find dependent libraries

I am trying to setup a Java project on a Windows computer that invokes R code using rJava/JRI. I have installed JDK 1.8, R 3.5.3 and rJava library in R on my computer. I have added the following to my Pathvariable: D:\Program…
AnjaM
  • 2,941
  • 8
  • 39
  • 62
4
votes
2 answers

Renjin - how to use values generated in java

I'm using renjin and I'm trying to use values I generated in the java code with the r-code, for instance: int x = 7; try { engine.eval("tmp<-c(x, 4)"); engine.eval("print(tmp)"); } catch (ScriptException ex) { ; } However, this does not…
newnewbie
  • 993
  • 2
  • 11
  • 26
4
votes
2 answers

new Rengine(...); fails without error

I'm trying to set up JRI with Eclipse on a Windows 7 x64 system. I tried it once on my Laptop and it worked. Now on my Desktop it fails although everything of the R, rJava and JRI installation is exactly the same. I set the JRI and R Paths correctly…
cokir
  • 41
  • 1
  • 4
3
votes
1 answer

How to calling auto.Arima function of R in java and store the result of forecast?

I'm new to R in Java. I use auto.Arima function of R in Java to forecast my data for 12 periods. but the period of forecast result is ten period. How can I do for 12 periods of forecast? I also want to store result of forecast at an array. This is…
Nurul
  • 61
  • 1
  • 2
  • 4
3
votes
2 answers

JRI and R - not able to capture output

I am trying to plot some graphs using Java and R (JRI and Rengine). When I write something like this in my code it works fine: re.eval("plot(c(1,5,3,8,5), type='l', col=2)"); But if I write this: re.eval("source(\"C:\\Documents and…
Bhushan
  • 18,329
  • 31
  • 104
  • 137
1
2 3
9 10