Menu
  • HOME
  • TAGS

Jiddle for executing R function published on OpenCPU

r,git,github,rstudio,opencpu

Try changing the ocpu.rpc call to: var req = ocpu.rpc("test",{ x : mydata // <--- input : mydata }, function(output){ $("tbody").empty(); $.each(output, function(index, value){ var html = "<tr><td>" + value.x + "</td><td>" + value.tv + "</td></tr>"; $("tbody").append(html); }); The error is coming because your function call passes an argument named...

OpenCPU: No method asJSON S3 class

r,opencpu,jsonlite

Two possible approaches. The first is to use the two-step OpenCPU procedure which allows you to pass arguments to toJSON so you can set the force argument. So: POST http://myserver/ocpu/library/stats/R/smooth.spline This will give you the key in the Location response header. You grab that, for example: GET http://myserver/ocpu/tmp/x123456789/R/.val/json?force=true The force...

Hosting private server Opencpu

opencpu

You don't need to connect to any OpenCPU cloud server if you have your own one. I have a server installed on my own computer and I even can run my OpenCPU apps offline, so I'm pretty sure about that.

How can OpenCPU run computationally expensive commands simultaneously?

r,opencpu

The OpenCPU cloud server executes all http requests in parallel, so first observation is false. Of course you must make simultaneous requests to do so. If your code consists of a single R function or script, OpenCPU won't magically parallelize things for you, if that is what you are after....

Using OpenCPU to download data used to generate a plot

javascript,r,opencpu

You probably want to create two functions in R: getdata: a function that retrieves the data from your database, and returns the data frame. makeplot : a function with a dataframe argument that creates your plot and returns nothing. Then your client you can call them separately. First the client...

Opencpu simple function json parsing not working

r,opencpu,jsonlite,opencpu.org

For an RCP with -H "Content-Type: application/json" the top level names in your JSON object must match the parameter names of your function. You can test this as follows: library(jsonlite) json <- '{"type":1,"data":[1,2,3,4,5,6,7,8,9,10],"quantil":[0.05,0.25,0.75,0.95]}' args <- fromJSON(json) result <- do.call(getLinearInterpolatedEstimateQuantil, args) So assuming you want to stick with the JSON payload...