Connecting to R on a remote computer

Oct 30, 2014 at 2:06 PM
I was wondering if it is possible to run a C# app that connects to R on a remote computer. For instance if someone has developed some R models on a some server, can I develop and test apps using R.Net that connect to this remote server?
Oct 31, 2014 at 7:36 AM
I'm looking for a solution for the same problem.

However, there exists another framework that handles this problem: DeployR from Revolution analytics.
I've run some tests, and I succesfully ran some code on a remote machine.
Downside of DeployR is the massive amount of overhead compared to R.NET
I'm talking about multiple abstraction layers between (remote) R and (local) C#.
This gives you more options about how to handle executed R scripts (asynchronous, blocking, polling, background jobs, etc, etc),
but your code will become more complex in handling these requests and responses.

So right now I'm looking for the simplicity of R.NET and the availabilty of remote connections like in DeployR.
Someone?
Oct 31, 2014 at 4:32 PM
Edited Nov 3, 2014 at 5:27 PM
I have created a separate process for R.NET to which my main application communicates.
I am using Microsoft's WCF "self-hosted" server. WCF stands for "Windows Communication Foundation".
WCF is capable of of several local and remote protocols including HTTP.
After defining the interface following the WCF rules, I run a utility program "svcutil" which generate the client code that I inseert into my application.
I was able to create a remote R host with only a day or two of effort.
Check it out.
Nov 1, 2014 at 2:58 AM
You can follow scubaskier's approach by wrapping the R subsystem in a WCF wrapper and if you simply focus in on eval and the console output, it shouldn't take you long . I have done a similar thing, but my was a little more complicated and only shoves the R interface and engine to be the out-of-process component, which allows me to keep the synthetic object model inside the original process space.
Nov 3, 2014 at 5:27 PM
I do not use R to display graphics. Instead I export plots to image files and display them using my own application. If one were to use WCF, or other RPC tech, to run R on a remote server. That remote server could be a web server and display the output using a web browser component. Or, one of the return values could be the path to a remote file server where the image file can be found. There are many possible solutions.
Nov 6, 2014 at 6:38 PM
Obi2Kenoby wrote:
I'm looking for a solution for the same problem.

However, there exists another framework that handles this problem: DeployR from Revolution analytics.
I've run some tests, and I succesfully ran some code on a remote machine.
Downside of DeployR is the massive amount of overhead compared to R.NET
I'm talking about multiple abstraction layers between (remote) R and (local) C#.
This gives you more options about how to handle executed R scripts (asynchronous, blocking, polling, background jobs, etc, etc),
but your code will become more complex in handling these requests and responses.

So right now I'm looking for the simplicity of R.NET and the availabilty of remote connections like in DeployR.
Someone?
What overhead is involved in the DeployR solution? Just out of curiosity.

sehunley
Nov 7, 2014 at 7:14 AM
sehunley wrote:
Obi2Kenoby wrote:
I'm looking for a solution for the same problem.

However, there exists another framework that handles this problem: DeployR from Revolution analytics.
I've run some tests, and I succesfully ran some code on a remote machine.
Downside of DeployR is the massive amount of overhead compared to R.NET
I'm talking about multiple abstraction layers between (remote) R and (local) C#.
This gives you more options about how to handle executed R scripts (asynchronous, blocking, polling, background jobs, etc, etc),
but your code will become more complex in handling these requests and responses.

So right now I'm looking for the simplicity of R.NET and the availabilty of remote connections like in DeployR.
Someone?
What overhead is involved in the DeployR solution? Just out of curiosity.

sehunley
For example, there is a specific R repository (on the DeployR server) where you need to upload your R files.
When it's in this repository, you can specify input & output parameters, so it can be used for web services (optional i think).

Other stuff:
-The deployR server can also be configured seperatly to use one or multiple 'nodes' for parallel job runs,
-you can choose if you want to communicate with the DeployR server through web API's or, through the RBroker Framwork (from deployR),
-deployR also offers some security features, where you have to enter credentials for accessing results of background R jobs,
-like i said in the previous post: different options to communicate in the RBroker framework: using asynchronous calls, blocking calls, background jobs, etc..
-...

Its all on their website if you're interested, including some tutorials to set everything up from scratch.
I got it all working with the stuff on their website, so it should'nt be that hard. It just a little overload of information when you start.