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
0
votes
0 answers

sbt JRI library not found

I want to make scala talk to R using the rJava library. Unfortunately, the JRI library is not found on the classpath. But in my sbt build it is included directly from a sub-directory. What is wrong with my setup? A minimal example can be found…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
0
votes
0 answers

What is the best practical way to use a complex R package from inside C++ or Java?

I am working with this R package that is non-trivial in its dependencies. For instance, it depends on splines::ns() (natural splines) library which has its own dependency on a C module. The input data for the package can be as large as a table of…
James
  • 237
  • 1
  • 12
0
votes
1 answer

Where does a variable created from JRI gets stored on my disk

I have a simple JRI Code : <% Rengine re = Rengine.getMainEngine(); if (re==null){ re = new Rengine (new String [] {"--vanilla"}, false, null); } re.eval("pull_data2 <- function(...){df3 <<-…
Ashish Anand
  • 3,531
  • 6
  • 34
  • 45
0
votes
1 answer

pass data to R from java using jri

I am trying to integrate R code inside java code.Primary objective is to be able to use predictions on models created in R. I am able to set up the environment properly and basic R commands are working fine. Issue: trying to push data from java to R…
0
votes
0 answers

Plot R graph using JRI

I was using JRI to plot a graph in JSP. If I use the below code, it works fine. Rengine re = new Rengine (new String [] {"--vanilla"}, false, null); re.eval("jpeg('')"; re.eval("plot(x,y)"); re.eval("dev.off()"); Instead if I use dotplot,…
Ashish Anand
  • 3,531
  • 6
  • 34
  • 45
0
votes
0 answers

rjava jri, Failed on "save", "saveRDS" commands

I am using rJava 0.95, with R3.0.1, java 1.8, and my development IDE is Intellij In my java code I have this line: org.rosuda.REngine.REXP result = re.parseAndEval("save(myObject,file=\"myoutput.R\")"); where "myobject" is a dataset object created…
Ziqi
  • 2,445
  • 5
  • 38
  • 65
0
votes
1 answer

Problems with R neural network results using JRI

So this is my problem. I am using a script in R to create a Neural Network to generate the missing values of a file, this file is as follows: Flag | Date | Time | Value V | 20100901 | 00:00 | 23180 V | 20100901 | 00:15 | 23280 V | …
0
votes
0 answers

Parsing script statements in Java with Regex

I have the following R script in a java String variable (including new line characters): d = 1 for (i in 1:150 ) { d = d + i; } print(d) What I'm looking for is to obtain the R functions, regardless of new lines. Following the previous example, I…
ps0604
  • 1,227
  • 23
  • 133
  • 330
0
votes
2 answers

JRI: how to get the console output in a Java String

I declare the JRI engine as follows in my Java program: REngine eng = REngine.engineForClass("org.rosuda.REngine.JRI.JRIEngine", args, new REngineStdOutput(), false); This works fine however I would like to get the console output in a Java…
ps0604
  • 1,227
  • 23
  • 133
  • 330
0
votes
0 answers

JRI causing Java out of Memory Exception

I have a Java program calling a R script using JRI. On calling re.eval("setMatValue('" + id + "'," + x + "," + y + "," + value + ")"); i get a java out of memory exception which is strange to me as neither the function in R is returning a value of…
Abaddon666
  • 1,533
  • 15
  • 31
0
votes
1 answer

JRI, Java and R: variable is not accumulated between evals

In this code variable xx returns 0 instead of 20, shouldn't it be calculated and its value kept between evals? String[] Rargs = {"--vanilla"}; Rengine re = new Rengine(Rargs, false, null); if (!re.waitForR()) { …
ps0604
  • 1,227
  • 23
  • 133
  • 330
0
votes
2 answers

EXCEPTION_ACCESS_VIOLATION when trying to use RJava

So I'm trying to make use of R from Java through JRI. I'm using the RJava plugin for Eclipse and the two test files which come with rJava are working fine (rtest and rtest2). But when trying to run this simple code fragment, I get an…
Koekje
  • 677
  • 1
  • 6
  • 17
0
votes
1 answer

JRI - Newlines in R Code

I'm currently using JRI, the Java package in order to use some of the functions provided by R. Let's say, my R command goes like this: qqnorm(sql_data[["LifeExpectancy"]], main="Life Expectancy") If I put this into my REngine.eval() function, it…
The_F
  • 45
  • 4
0
votes
1 answer

Passing JVM parameters to manifest file (for JRI + Javafx deployment)

I'm trying to deploy, on a self contained mode, a JavaFx GUI that uses R with the JRI interface. The application runs perfectly on Net-beans, and when I'm disabling the code that uses JRI, it also runs great on a stand alone mode (with a clickable…
Yehoshaphat Schellekens
  • 2,305
  • 2
  • 22
  • 49
0
votes
1 answer

No output is coming not even error java with jri call to R

Below is my code package org.quad.test; import org.rosuda.JRI.Rengine; public class JRT { public static void main(String[] args) { System.out.println("Cannot load R"); // new R-engine Rengine re = new Rengine(new…
smali
  • 4,687
  • 7
  • 38
  • 60
1 2 3
9
10