Questions tagged [opencpu]

OpenCPU is a software framework for embedded statistical computation and reproducible research. The server exposes a web API interfacing R, Latex and Pandoc.

OpenCPU provides a REST API to the R computing language. One of the goals is to be able to embed R functionality in scalable systems and web applications, without requiring the user or system to install R.

OpenCPU deals with some of the technicalities that come with R and statistical computing, so that you can focus on your application. Furthermore, OpenCPU implements the concept of Open Computing. In a nutshell this comes down to the following:

Any client can execute arbitrary R code on an OpenCPU server. All R code on the server is by definition Open Source, and readable by anyone. When you publish your own code on the server, it authomatically becomes Open Source. A helpful UNIX analogy is that you have at least r-x privileges on anything on the system, and you rwx in your home directory.

We can mention the two sides of opencpu:

  • On the server side, opencpu serves R packages
  • On the front end side, opencpu is also a js library to interact with the REST API
268 questions
3
votes
1 answer

Load h5 keras model file in R

I'm building a R package for binary classification and I'm using opencpu to host it. Currently I've saved the h5 file as .RData file(serialized), which is then loaded in the environment using the .onLoad() function in R. This enables the R script to…
Swapnesh Khare
  • 109
  • 1
  • 10
3
votes
1 answer

Openshift command terminated with non-zero exit code: Error executing in Docker Container: 137

I am running an opencpu based image on openshift, every time the pod starts, after just a few seconds, it crashes with the error: command terminated with non-zero exit code: Error executing in Docker Container: 137 Event tab shows only below three…
Hound
  • 837
  • 17
  • 31
3
votes
1 answer

How to hide your library code in OpenCPU

If you are using OpenCPU, you will notice that anyone can access your /ocpu/library/[your_library]/R/ directory and see all the source code of your backend application. How can you prevent this from happening?
zolastro
  • 918
  • 12
  • 29
3
votes
1 answer

How to set 2 different urls for opencpu?

I want to set 2 different urls for OpenCpu. Is it possible? ocpu.seturl("https://public.opencpu.org/ocpu/library/igraph/R"); ocpu.seturl("https://public.opencpu.org/ocpu/library/customlibrary/R");
anfas
  • 356
  • 2
  • 3
  • 13
3
votes
1 answer

Permission issue while reading files from opencpu server

when trying to read files deployed in my ec2 instance while running my opencpu app I get file connection error. The same works with the single user version on rstudio server. I checked the logs in /var/log/kern.log and found this apparmor="DENIED"…
Sujay DSa
  • 1,172
  • 2
  • 22
  • 37
3
votes
1 answer

How many requests can be processed simultaneously by R OpenCPU

I am new to OpenCPU, I look at the documents at https://www.opencpu.org/, It looks that OpenCPU can process http requests concurrently? I ask so because R itself only has single-thread mode, and how many requests can it process concurrently? Thanks.
Tom
  • 5,848
  • 12
  • 44
  • 104
3
votes
1 answer

put multiple files in a zip file and download it using javascript

I have multiple image addresses. The address looks like https://tmp.ocpu.io/x05fcaa7ec4/graphics/last/png?width=800&height=600. Above address may expire after 24 hours. So please just use following two addresses.…
WCMC
  • 1,602
  • 3
  • 20
  • 32
3
votes
2 answers

How to run a custom.R script using OpenCPU

I have a question that seems like it should be simple, however it doesn't seem to be addressed in the OpenCPU API documentation. I have setup and configured my OpenCPU server just fine, I can browse http://localhost/ocpu/test/ and I can explore…
Jason Tham
  • 123
  • 1
  • 8
3
votes
1 answer

R package Error in get("rgeos", envir = .MAPTOOLS_CACHE) : object 'rgeos' not found

I'm new to R and it's package system, just wrote my first package with the intent to use it with OpenCPU. while executing this function: #' Create a PNG which shows interpolated senseMap Data #' #' @export #' @import jsonlite #' @import sp #'…
mdragunski
  • 31
  • 3
3
votes
1 answer

t-test using OpenCPU

I tried to use t-test in R using OpenCPU as follows - and ocpu.seturl("//public.opencpu.org/ocpu/library/stats/R") var x =…
Dinesh
  • 2,194
  • 3
  • 30
  • 52
3
votes
1 answer

How to setup AWS cluster to work with openCPU?

I have two EC2 machines: master and slave. SSH keys are generated for user ubuntu and saved to ~/.ssh/authorized_keys on both machines. Thus I can use the cluster from master node as ubuntu user like this: library(doSNOW) cluster_options <-…
redmode
  • 4,821
  • 1
  • 25
  • 30
3
votes
0 answers

Provide datasets dynamically via GET using opencpu?

I am not sure whether I am on the right track with my question, so here is what I am trying to do: I would like to implement something like the data api endpoints, e.g.: hadley.ocpu.io/ggplot2/data/msleep/csv and hope to be able to use all the great…
Matt Bannert
  • 27,631
  • 38
  • 141
  • 207
3
votes
0 answers

RODBC on OpenCPU can't find dependent libraries

There are a couple of related threads here, but the gist of my attempt to connect to Vertica with R over OpenCPU and vRODBC is: I started with RJDBC, which works fine in RStudio (even the server RStudio edition), but OpenCPU/rApache doesn't like…
3
votes
1 answer

Opencpu simple function json parsing not working

Hi I want to have a simple function for my local opencpu development server. getLinearInterpolatedEstimateQuantil <- function(x, type, probs){ result = quantile(data, type, probs) result #print for simpler debug } Example Debug input would be…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
3
votes
1 answer

OpenCPU: No method asJSON S3 class

I am trying to get the JSON representation of the following resource: POST http://myserver/ocpu/library/stats/R/smooth.spline/json The error I get is No method asJSON S3 class: smooth.spline. The result of a smooth.spline() call has the following…
Maurizio
  • 547
  • 5
  • 13
1
2
3
17 18