opencpu

Is there a mechanism to persist/record data from requests to an OpenCPU server?

大憨熊 提交于 2019-12-24 14:55:10
问题 Firstly, I appreciate there are many good reasons NOT to do this, but for interest, my question is: is there a recommended (or tolerated) method to persist information from an http request to the R session which is running the server? As an example, a trigger in an external system fires an http request on update, which contains basic information (time of update). What is the best way to make that (now-updated) time variable available in R? As an example below, I tried using the ..\identity

Is there a way to run a script through Opencpu without creating a package?

爷,独闯天下 提交于 2019-12-23 23:00:06
问题 I am new to opencpu and I am trying this : Create a script to load dataframe in memory (on server of course) Give a method to query this dataframe through GET api. Can this be done for a large dataframe to keep it loaded once? And can this be done without writing a R package (which is the only way I have found so far to access R scripts through opencpu) 来源: https://stackoverflow.com/questions/26025430/is-there-a-way-to-run-a-script-through-opencpu-without-creating-a-package

How to set the opencpu default port for single user

陌路散爱 提交于 2019-12-22 17:56:59
问题 I am working with opencpu. I installed the opencpu as a single user mode. When the session is expired the link is down and sometimes the port number is changing dynamically. I would like the port to be constant during every run even the current session is expired. 回答1: You can set the port when you start the single user server: library(opencpu) opencpu$stop() opencpu$start(1234) This will start opencpu on port 1234. I recommend you try the cloud server, which always runs on port 80 (http) and

Integrating R and its graphics with existing Javascript/HTML Application

[亡魂溺海] 提交于 2019-12-22 07:50:08
问题 I have an existing Javascript/HTML Application. I wanted to use power of R Programming 's scientific computing and graphics. My aim is to, Send some data from Javascript app. Call predefined R functions with the data input. Get the output get the output in the form of both text and graphics. Display it in the HTML page. How to achieve this, Should I run R continuously, use something like web sockets and connect to R? If doing How to pass R scripts to execute and get the output pack? There is

Integrating R and its graphics with existing Javascript/HTML Application

[亡魂溺海] 提交于 2019-12-22 07:50:07
问题 I have an existing Javascript/HTML Application. I wanted to use power of R Programming 's scientific computing and graphics. My aim is to, Send some data from Javascript app. Call predefined R functions with the data input. Get the output get the output in the form of both text and graphics. Display it in the HTML page. How to achieve this, Should I run R continuously, use something like web sockets and connect to R? If doing How to pass R scripts to execute and get the output pack? There is

Are data objects persistent in openCPU's R session?

自闭症网瘾萝莉.ら 提交于 2019-12-19 08:53:28
问题 I would like to provide a web tool that requires access to a large dataset. Preferentially, this R data object should be loaded into memory once and then be available for user-defined queries. Does the openCPU framework support persistant data objects in any way or does every query begin with a blank slate? 回答1: The OpenCPU API is stateless, there is no way to keep a process alive in between requests. But you can easily solve your problem by putting your dataset into a package, and installing

Are data objects persistent in openCPU's R session?

旧时模样 提交于 2019-12-19 08:53:19
问题 I would like to provide a web tool that requires access to a large dataset. Preferentially, this R data object should be loaded into memory once and then be available for user-defined queries. Does the openCPU framework support persistant data objects in any way or does every query begin with a blank slate? 回答1: The OpenCPU API is stateless, there is no way to keep a process alive in between requests. But you can easily solve your problem by putting your dataset into a package, and installing

Custom R package on OpenCPU / Package found, but no functions visible

你说的曾经没有我的故事 提交于 2019-12-13 16:22:12
问题 CI have written an R package for OpenCPU and want to use it on my own Cloud server. I cannot access any functions even though the package itself is recognized and can be updated, and I can access other (non-custom, e.g. base or stats) packages normally via POST and GET. I have installed the custom package together with all dependencies to /usr/local/lib/R/site-library and I can use the functions from within an R session locally on the server. > TestConnectivity function (x = 100) { return(sum

Test R app via openCPU localy

戏子无情 提交于 2019-12-13 00:33:52
问题 I wrote an R package and now I want to provide let's say a small demo fronted as a webapplication. For this I already wrote a index.html file which I saved to the <pkgRoot>/inst/www/ folder. I also installed the opencpu package which works fine wehen I use it via the localhost:<portNum>/ocpu/test/ "Interface", where I already can see my Package and use the Ajax POST and GET requests in order to see the package is doing what it's ment to do. But now im stuck in a sense that I do not know how

Using OpenCPU to access custom R function

試著忘記壹切 提交于 2019-12-12 05:08:31
问题 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="prob") output = data.frame(data$customerid,data$pred[,2]) return(output) } I need to make this function enabled in webserver, where an external application feeds data and retrieves the output. The problem is, the model needs to be preloaded and cannot load into R env for each request. The function needs to support