Hi 2 questions- 1. Is there a package that will allow me to run R scripts (entirely) from Java? 2. If so, is there a way to capture the output of those scripts, (including images) and embed them in my SWT java app? My challenge is I have a java app that does some statistical chores- it would be fantastic if the users could use their R skills to modify a script in whatever R environment they like and then my app could use that script to calculate the results and display them in the app. I have found StatET and JavaGD with rJava/JRI and read through all the docs... its seems possible that some combination may give me what I want, but its not very clear. Any suggestions anyone? Thanks! -- View this message in context: http://www.nabble.com/Using-R-in-Java--tp22104843p22104843.html Sent from the R help mailing list archive at Nabble.com.
nicro schrieb:> Hi 2 questions- > 1. Is there a package that will allow me to run R scripts (entirely) from > Java? > 2. If so, is there a way to capture the output of those scripts, (including > images) and embed them in my SWT java app? > > My challenge is I have a java app that does some statistical chores- it > would be fantastic if the users could use their R skills to modify a script > in whatever R environment they like and then my app could use that script to > calculate the results and display them in the app. > > I have found StatET and JavaGD with rJava/JRI and read through all the > docs... its seems possible that some combination may give me what I want, > but its not very clear.The JRI part from the rJava package does exactly what you want. Simple data types like numbers or strings are directly returned as java objects. But I'm afraid for the images you have to use the files system indirection. If needed I can post an example, Christian
Hi nicro, There's a way that we use a lot in our projects which allows Java to call R and capture the text/table/image outputs. In Java We call 'Rscript exampleScript.R' via shell command. The R script should generate an XML file when it finishes, describing what output was generated, then java can pick them all up. We are also trying to look into Biocep -- it looks impressive in terms of its capability in handling R and bridging Java-R. Hope this helps. Thanks Fan -- View this message in context: http://www.nabble.com/Using-R-in-Java--tp22104843p22158387.html Sent from the R help mailing list archive at Nabble.com.