How can I make a request from a backend application to RStudio to execute code.

I'm building the backend of an application in C# and I'm trying to build a request that includes rscript/code, which then goes off and hits RStudio, executes this code, and then sends the result back. How can I do this?

I didn't notice this possibility with RStudio Connect API. I did see the RStudio Workbench has an executeR function, but this seemed to be made for the frontend using JavaScript. I specifically need to be able to do this from the backend.

Someone had told me I might be able to do this with Jenkins as there is a R plugin or something for it. I'd prefer to do it from C# if I can.

I would greatly appreciate any feedback.

I would question involving RStudio, which after all is only an IDE to help developers write R code, i.e. its a lot more than the R runtime.
I think you would be trying to invoke Rscript

Ok. Yeah, I know very little about R. What would be the best and most secure way for executing R code via a HTTP client? I see plumber is an option.

I see RStudio Workbench has a function called executeR(). I basically want to do this, but hitting the API from a backend with HTTP.

ok, my suggestion relating to rscript was assuming a single device, if you want your consumer device to be serviced via http, plumber sounds good. The main plumber page gives examples, and discusses hosting, have you looked there ?

An API Generator for R • plumber (

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.