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
2
votes
3 answers

Can JRI access user-installed packages on Vista?

I've developed a Java application that uses JRI to make use of the ptw package. On Linux (Ubuntu 10.04, R 2.10.1, JRI 0.5.0) it works fine. However, on Vista (R 2.12.0, JRI 0.5.0) when the application evaluates "library(ptw)" the following error…
Chris Pudney
  • 371
  • 2
  • 5
2
votes
0 answers

Issue with saving the plotted data in JRI

re.eval("cpu_plot <- function (fore) {;plot(fore, xaxt=\"n\", main=\"Forecast and Plot for the CPU Utilization\", xlab=\"Month\", ylab=\"CPU Utilization\");a = seq(as.Date(\"2015-01-01\"), by=\"months\", length=13);axis(1, at = decimal_date(a),…
Ashish Anand
  • 3,531
  • 6
  • 34
  • 45
2
votes
1 answer

rJava JRI Error R is already initialized (R Call java(new Rengine in Java ))

I could call R from Java and call Java function from R successfully both. However, when I'm trying to use rJava JRI to call Java from R, and Java code instance new REngine. It failed reports R is already initialized and then quit R directly. My…
Dawei
  • 41
  • 5
2
votes
1 answer

Returning the coefficient parameters from JRI

I am trying to run R summary command through JRI to get the result for mulitvariate Linear Regression result <- lm(Performance Score ~ Department+Grade,data = StudentData) summary(result) Call: lm(formula = Performace.Score ~ Department + Grade,…
Akashdeep
  • 21
  • 1
2
votes
1 answer

How to visualize my R plot in my JFrame with JavaGD?

I am new to JRI/rJava/JavaGD and have some problems with it. I drew a simple R plot with JRI and want to include this plot in my customized JFrame. I added the GDCanvas in which the plot should appear to my JFrame. However the plot is not displayed…
jules_123
  • 33
  • 6
2
votes
1 answer

Rengine.eval() returns null

I'm using the JRI package to build an application using the catR package. On my Mac works perfectly, but when I tried on Windows, the function thetaEst always returns null - only this function. Is there any configuration specific for Windows..? Here…
cmsantos
  • 317
  • 1
  • 4
  • 13
2
votes
1 answer

Rengine.eval() return null when calling predict()

I have recently started using JRI to run R code/script within Java. While most of the statements appear to work fine (such as simple assignments Test <- 123, and specific functions like source(...) read.csv(...), rpart(...), data.frame(...)), there…
user1589408
  • 21
  • 2
  • 6
2
votes
1 answer

R JRI: trying to create data.frames from Java using REXP.createDataFrame

I'm trying to create a data frame in R taking the data from an ArrayList in Java. The code below seems to be the official JRI test suite (see this link) however it doesn't even compile, for example in the first statement RList doesn't have a put…
ps0604
  • 1,227
  • 23
  • 133
  • 330
2
votes
3 answers

Problems with JRI

I am trying to run an example of JRI and being unsuccessful, here is a link to the example. http://blog.comsysto.com/2013/07/10/java-r-integration-with-jri-for-on-demand-predictions/ import org.rosuda.JRI.Rengine; import org.rosuda.JRI.REXP; public…
2
votes
0 answers

Trying to integrate R with my Java application using JRI, but I'm getting error. Can anyone explain the cause and solution?

I need to integrate Java with R to run some math commands and make plots using features of R. Following part of code is giving error. public static void main(String[] args){ HelloRWorld r = new HelloRWorld(); …
Punit
  • 69
  • 1
  • 7
2
votes
2 answers

JRI - How locate Errors in R

So basically, I am using Java, JRI (R for Java) and RJDBC (with the help of JRI), which all work out pretty well. Now, I want to make my program as foolproof as possible. Let's say, that the string SQL_command is some kind of rubbish and not really…
The_F
  • 45
  • 4
2
votes
0 answers

R java interface R_HOME is not set

I'm I'm struggling with JRI installation on mac with no success. I got an R 3.1 working version, and a JDK working version 1.7.0_67. I installe RJava trougth the command install.packages("rJava") successfully, but when I try to run the examples…
2
votes
1 answer

How-to create plots in R using JRI

This is basically the inverse to this question: How to plot a graph using R, Java and JRI? . I want to create a plot in R from a Java program and store it on the harddrive. This is not about displaying an R plot in a java window. I'm using JRE as…
Chris
  • 721
  • 1
  • 10
  • 23
2
votes
3 answers

Problem loading R own created libraries in Java/JRI code

I created my own new R library (called "Media"). There is no problem when I try to load it with RGui, and I can call the functions defined in the new package. This is how I load it: > library(Media) But, I'm also trying to call that functions…
Guido
  • 46,642
  • 28
  • 120
  • 174
2
votes
1 answer

exporting plotted variable shows blank image

I am doing java and R integration using JRI. Please find below script String path = "C:\\Users\\hrpatel\\Desktop\\CSVs\\DataNVOCT.csv"; rengine.eval("library(tseries)"); rengine.eval(String.format("mydata <-…
Hardik Patel
  • 937
  • 3
  • 14
  • 39
1 2
3
9 10