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
1
vote
1 answer

Evaluating expressions called from Java in R. Out of Memory Error: Java Heap

I have an issue loading a large dataset into R from Java. The problem is actually with the function I am using: re.eval(). I want to load a file into R so that I can analyse/manipulate it in R, however I want to do this from Java (this is in order…
Aran Brady
  • 139
  • 1
  • 12
1
vote
2 answers

Call R from Java using JRI, how to cast return value

I'm executing some R commands from Java using JRI.I want to use the results from R in my Java for further calculations but I have no idea how cast the returned object. call code in Java: REXP x; System.out.println(x =…
1
vote
2 answers

Read in a csv file in R from Java (using JRI)

I want to load a csv file into R from Java using JRI. For some reason when I try and do this, the program terminates and returns no error or result. Here is my Code: REXP x; x = re.eval("data<-read.csv(file='C:\\data.csv', head=TRUE, sep=',')"); x =…
Aran Brady
  • 139
  • 1
  • 12
1
vote
1 answer

JVM crashes after one successful request when using JRI

I am using the JRI api to use "R" in Java. I have created a web-service which has the JRI code . When I consume this web-service for the first time it works properly, but with a subsequent request the JVM crashes and says : "The crash happened…
1
vote
1 answer

trouble installing JRI (R to java)

I'm wondering if anyone has experience with my error message or has any advice. When I run the ./configure file it runs with no error. When I run the make file I get make -C src JRI.jar gcc-4.2 -arch x86_64 -std=gnu99 -c -o Rengine.o Rengine.c -g…
csta
  • 2,423
  • 5
  • 26
  • 34
1
vote
2 answers

rJava not installing on new laptop

Just received a new GTX laptop, and for whatever reason, I am simply not able to install rJava. No matter what I do with the Java and JDK installs, I get the following message. I have been uninstalling, rebooting, re-installing, Java (latest…
fibrou
  • 313
  • 1
  • 5
  • 15
1
vote
2 answers

no output when .jar is executed

I built an application in Netbeans 6.8 and made project.jar file. When I run it, it works only on my computer, but not on any other computer. However, when I made any simple application, that doesnt use any libraries, it works fine on any computer.…
troger19
  • 1,159
  • 2
  • 12
  • 29
1
vote
0 answers

R code in Java working in Linux but not in Windows

What am I doing? I am writing a data analysis program in Java which relies on R´s arulesViz library to mine association rules. What do I want? My purpose is to store the rules in a String variable in Java so that I can process them later. How does…
xvlaze
  • 837
  • 1
  • 10
  • 30
1
vote
0 answers

How to write a CSV and store it as a string in JRI?

I am looking for a way to store CSV formatted text into a string in JRI (Java/R Interface). Currently, the only way I know for dealing with writing CSV files is: write.csv(MyData, file = "MyData.csv") Which formats MyData into CSV and writes it to…
xvlaze
  • 837
  • 1
  • 10
  • 30
1
vote
0 answers

JRI program terminates java during REngine creation

I want to call an R script using Java. I am trying the JRI method to call the R script. However my JVM gets terminated when creating an Rengine. I am running one of the examples which has been provided alongside rJava library installation in R. Code…
Anup Hegde
  • 11
  • 1
1
vote
1 answer

Cannot load libR.dylib with JRI on OSX

I have a custom compiled R installation. I had to custom compile it in order to use MKL. In my build.sbt I have the following line javaOptions += "-Djava.library.path=/Users/me/R-3.3.2/lib:/Users/taylor/Library/R/3.3/library/rJava/jri and…
user6467981
1
vote
0 answers

JRI library(fgarch) not working

I am new to R and trying to load fgarch library using JRI REngine. Following is the code that I used. rEngine.eval("addpkg('fgarch', 3010.82 )"); rEngine.eval("library(\"fgarch\")"); rEngine.assign("r", returns); REXP result =…
VSK
  • 359
  • 2
  • 5
  • 20
1
vote
0 answers

call Rscrit from java

I have ensemble of R scripts doing classification staff. I want to create an graphical interface to my application with java. I installed rJava and integrate JRI with java and every thing work correctly coz i tried a simple example "calculate the…
naya
  • 11
  • 1
1
vote
0 answers

How to retrieve JRI results as same as R terminal

When I try the following in R terminal library(MASS) school.fre = painters$School school.fre = table(school) cbind(school.fre) I get the following as the result > cbind(school.fre) school.fre A 10 B 6 C 6 D 10 E…
andy
  • 643
  • 2
  • 12
  • 20
1
vote
1 answer

some commands failing in rtest.java when using rJava/JRI package from eclipse

I am trying to test rJava package from Java using Eclipse IDE. While testing rtest.java which comes in rJava/JRI package some commands are failing but some are sucessfull. Can't understand why or how to resolve it. Following are the system…
pmr
  • 998
  • 2
  • 13
  • 27