Passing user name as variable and returning the results of r script using deployR

107 Views Asked by At

Consider a r script implementing a simple function which returns histogram plot from dataframe in r consisting of three columns say username, monthname and monthly salary. Now how to integrate to deployR where a simple http call can pass the parameter of username and get histogram related to that user? As I am not a application developer and used to integrate BI Applications using simple http calls with passing username as one of the URL parameters, I want to implement same here. Any possibility? say http://url/username=XYZ which returns me the plot for that user.

1

There are 1 best solutions below

0
On

Without writing a specific application or a web service acting as a proxy, I don't think it would be possible. The reason is that in order to run an R script in DeployR, you need more than one call to the API. This is regardless of the client library you want to use. You will have to :

  1. Setup the DeployR session and context execution
  2. Set the parameters
  3. Launch the R script
  4. Get the results

As far as I know, it can't be done in one HTTP shot.