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
2
votes
1 answer

How to download pdf generated with rmarkdown via HTTP using OpenCPU

I'm trying to download a pdf that I've created in a R backend using rmarkdown, but I'm not sure how to retrieve it back via HTTP, if that's even possible. I'm using Angular6 in the front-end and I'm just using basic GET/POST methods to communicate…
zolastro
  • 918
  • 12
  • 29
2
votes
0 answers

OpenCPU docker image fails with libssl.so.1.0.0 invalid ELF header

I have run into a problem with the latest opencpu/base and opencpu/rstudio docker images. They are failing right from the start: > docker run --name ocpu -t -p 80:80 opencpu/rstudio /usr/lib/rstudio-server/bin/rserver: error while loading shared…
2
votes
1 answer

Install rgdal in rstudio-server through Docker

I am using the opencpu/rstudio docker image. Docker runs through a Virtual Machine because I am a Windows user. After running rstudio-server, I try to install my R package from github. Everything works fine, until rgdal should be installed. I get…
PhilG
  • 351
  • 1
  • 4
  • 15
2
votes
1 answer

User-defined environment variables are missing in OpenCPU

I defined some environment variables on CentOs and they are visible from R shell. ]$ sudo R -e 'Sys.getenv()' AMAZONREDSHIFTODBCINI /etc/amazon.redshiftodbc.ini ODBCINI /etc/odbc.ini ODBCSYSINI …
leventunver
  • 3,269
  • 7
  • 24
  • 39
2
votes
1 answer

Opencpu data caching

My speciality is java. I use R for very specific analyses. PROBLEM My understanding is that each API call to opencpu opens a new R session. My function will classify the data input using the predict method of a linear discriminant analysis (lda…
Jake
  • 4,322
  • 6
  • 39
  • 83
2
votes
1 answer

r opencpu root dir for reading csv

I have opencpu (single server) up and functioning. My first function will open a dataset from a csv file stored on my hard drive. Where should I deploy the csv file? (I tried my apps www directory, but it doesn't work) In sum: within an opencpu app,…
Jake
  • 4,322
  • 6
  • 39
  • 83
2
votes
1 answer

Store session details for future reuse after data upload in opencpu

In that exemple of an opencpu app, a file uploaded is used by the function printsummary once imbricated into the call to readcsvnew. I am looking for a way to apply to the same dataset a number of functions one after each other independently. I…
YCR
  • 3,794
  • 3
  • 25
  • 29
2
votes
2 answers

RODBC connection failing in opencpu

I need to fetch data on a SQL Server through opencpu. RODBC works perfectly with single-user version of opencpu. However on the cloud server I get this error: first argument is not an open RODBC channel In call: RODBC::sqlQuery(dbhandle,…
Gratien
  • 227
  • 2
  • 9
2
votes
1 answer

How to send -d flag from curl with Guzzle

I have the following cURL statement curl http://localhost/ocpu/library/stats/R/t.test -d "x=x0e48e4cb3f&y=x09aaf63ea6" When I run this in the terminal everything is fine and I get the response I want, a completed calculation. Now I'm trying to…
FarCreek
  • 47
  • 6
2
votes
0 answers

Starting OpenCPU single user on windows

When I try and load the openCpu library in Rstudio and RGui on Windows server 2008 R2, SP1 I get the message: "The program can't start because MSVCR90.dll is missing from your computer. Try reinstalling the program to fix this problem." The script…
MikeP
  • 751
  • 5
  • 6
2
votes
0 answers

How to get a JSON table back from an openCPU RPC request?

I've written an R function in my package which returns a data frame. I'd like to call my function from javascript and use it to populate a table. I am able to successfully call the function using the ocpu/test interface and get back JSON. I'm…
wdkrnls
  • 4,548
  • 7
  • 36
  • 64
2
votes
0 answers

EWMA in OpenCPU

I would like to generate control chart (EWMA) in RPlot OpenCPU. I use jQuery.rplot plugin from the opencpu.js library to call the R function called randomplot. included in this R package. But I dont see any function to do so. I checked…
Elbert
  • 516
  • 1
  • 5
  • 15
2
votes
1 answer

equivalence of -d parameter in curl in httr package of R

I'm following the official manual of opencpu package in R. In chapter 4.3 Calling a function It uses curl to test API: curl http://your.server.com/ocpu/library/stats/R/rnorm -d "n=10&mean=100" and the sample output is:…
Bamqf
  • 3,382
  • 8
  • 33
  • 47
2
votes
1 answer

How to set the opencpu default port for single user

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…
sharon paul
  • 93
  • 2
  • 9
2
votes
1 answer

Is opencpu useful as an API called by a web service?

Hi Opencpu is a really cool tool. But now I want to use a Data Processing Unit (DPU) in a web-service. Can it be used in a production environment where there are lots of requests which call r functions and scripts which only require a short amount…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292