The new openCPU platform allows integration of R functions within HTML/javascript. However I have been struggeling with the implementation. Could somebody provide an example of how to upload your self-designed R function to openCPU and call it with its parameters via javascript?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- R - Quantstart: Testing Strategy on Multiple Equit
Thanks for your hints. I have tried to deduce some code for a simple example from your app (see blow). I cut out everthing that is not crucial and created some comde that should just run a simple R code following a button press. However there seems to be a mistake which I have not been able to figure out.
The solutions above do not work anymore because of modified openCPU server paths and lack of JSON support. Modified working solution
Here is a standalone HTML page that does the job. It sends a request to the openCPU server and gets a json object back with keys that point to the appropriate objects on that same server which I then inject into the page. Just download the code and click on the "Run Code" button.