1

I have a java program that produces a String[][], this array is then turned into a csv file. For example my program may output in something like this,

String[][] test = {{name, bc1, bc2, bc3},{name1, 10,20,30},
                   {name2, 5,15,20},{name3, 6,12,18}}

and the csv (test.csv) file looks like

name   bc1   bc2   bc3
name1  10    20    30
name2  5     15    20
name3  6     12    18

Now I could take this csv file and create a R graph, for instance

testR -> read.csv("test.csv")
boxplot(testR)

My question is: Can I run R "within" java and have my java program handle R and perhaps output the R graph as a pdf or another graphical file? Thanks

1 Answer 1

2

Check out the JRI/rJava project which provides a Java/R interface. After you download the package, see the examples directory.

Another option is to use the RCaller library (though I've never tried it myself...this question suggests potential performance issues).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.