Skip to content Skip to sidebar Skip to footer

Using Opencpu To Access Custom R Function

I have an R code which loads the RandomForest model, I am looking to create a function which load(model) randomforest_func = function(data) { data$pred = predict(model,data,type

Solution 1:

The above code should be running in R and available at http://localhost:1234/ocpu/

No. You need to create a package in which you put your custom functions. If the package is called foo, then the app will be available at

http://localhost:xxxx/ocpu/library/foo/www

(where xxxx is a random value for the port, given when you run opencpu$browse()). Also, you have to use ocpu.call, not ocpu.r_fun_call.

Solution 2:

This should help with deploying it as an app, making it easier for any external application to consume the services.

This should help with including the model.

Post a Comment for "Using Opencpu To Access Custom R Function"