简体   繁体   中英

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

Consider ar 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM