How do you run an R program from Java?
You might want to take a look at these three projects.
JRI - Java/R Interface
Rserve
RCaller
calling R script from java
You just want to call an external application: wouldn't the following work?
Runtime.getRuntime().exec("Rscript myScript.R");
Run R script using JAVA program
You just want to call an external application: wouldn't the following work?
Runtime.getRuntime().exec("Rscript myScript.R");
Credit goes to stackoverflow itself
How to run R script from java using Process builder
The constructor of ProcessBuilder
takes not the command line, but the command and its arguments. So, in this example it should be constructed as
new ProcessBuilder(userPrefs.get("PathToR",null), pt);
This builder will run R
with single argument pt
. Notice, that even if pt
contains spaces, it will be interpreted as a single argument.
Related Topics
Google Sign in Signed APK Not Working
Tcp\Ip Client - Ehostunreach (No Route to Host)
Android: Google Maps API - Change Position of Maps Toolbar
How to Apply Custom Filters in a Camera [Surfaceview Preview]...
Driver Jdbc Postgresql with Android
Getting Wrong Month When Using Simpledateformat.Parse
Online Radio Streaming App for Android
Android: Specify Two Different Images for Togglebutton Using Xml
What Does Transitive = True in Gradle Exactly Do (W.R.T. Crashlytics)
Android App Bundle Introduces Resource Not Found Crash in Android App
How to Show Ellipses on My Textview If It Is Greater Than the 1 Line
Unhandled Exception Type Error
:App:Dexdebug Execexception Finished with Non-Zero Exit Value 2
How to Have the Code Pause for a Couple of Seconds in Android
Android SQLite and Huge Data Sets
Is There an Advantage to Running Jruby If You Don't Know Any Java