Questions tagged [plumber]

plumber is an R package used to create HTTP APIs from R. It uses annotations above your function definitions to define the structure of your API using existing R code.

The plumber R package allows R users to create HTTP APIs from their R code.

  • Official documentation - Includes documentation about the various features and online examples.
  • CRAN - The package is available on CRAN for easier installation.
307 questions
0
votes
1 answer

Files not found in R when writing a package: what is the right approach?

I'm writing an R package using plumber. The main code: #' @title startServer #' @description Start the api server on port `port` #' #' @param port Port number #' @return none #' @examples #' startServer(8000) #' @export startServer <- function(port)…
Kurt Sys
  • 11
  • 4
0
votes
1 answer

Model Plumber API curl check with JSON/DF

I have created a dummy model using the below code : #get the data data(Boston, package="MASS") # train a model for median house price as a function of the other variables bos_rf <- lm(medv ~ crim + indus + dis , data=Boston) # save the…
Learner_seeker
  • 544
  • 1
  • 4
  • 21
0
votes
0 answers

Can't access plumber API with public IP

Problems with accessing the public API hosted on digitalocean.com I have been struggling with the R lib Plumber to generate a web API from RStudio. I manage to deploy a local API with swagger at http://127.0.0.1:8002/__swagger__/ which works fine. I…
0
votes
1 answer

Making GET requests to a Plumber API from an Excel macro issues

I'm trying to make an Excel macro that can make a GET request to a Plumber API that is hosted on RConnect. I have developed the Plumber API, it works as intended. During testing, I ran it on my local machine, so it was running on 127.0.0.1:xxxx, and…
skippy_winks
  • 778
  • 3
  • 14
  • 31
0
votes
0 answers

How to set timeout properly on httr::POST?

I have created an app deployed on shinyapps.io. From this app, I can click a button which triggers a call to an API written with plumber (deployed on AWS): observeEvent(input$button_clicked, { print("calculate called") res_calculate <-…
vwrobel
  • 1,706
  • 15
  • 25
0
votes
1 answer

google app engine flexible with docker 'site cannot be reached'

I want to server R model using App Engine. I am following this example R with app engine, but stuck. I tried several methods but still have issues. Any guidance on this issue? Please refer to my code app.yaml runtime: custom env:…
Tokci
  • 1,220
  • 1
  • 23
  • 31
0
votes
1 answer

Error while deploying R using plumber in Google App Engine Flex with Docker

What am doing? I am trying to deploy a R model on Google App Engine Flex with docker container. My final objective is to serve model as API. I am getting errors when deploying app using plumber and docker container. R code with plumber runs fine on…
Tokci
  • 1,220
  • 1
  • 23
  • 31
0
votes
1 answer

Would R Plumber served through Apache be able to handle multiple requests?

I'm pretty new to R Plumber. I'm trying to deploy an R function as an API to be able to do live calculations for a web app. I understand R is single-thread by default and, hence, Plumber inherits the same limitations to deal with requests. The R…
Leitouran
  • 578
  • 3
  • 16
0
votes
0 answers

deploy running docker in external IP (VM host)

My API couldn't be published on the specific ip address (VM host) when using docker First, I run the file in terminal : Rscript run.R This works fine, my api is up and running on the ip address http://35.157.131.3:8000/swagger/ . After which, I…
0
votes
0 answers

redirect plumber api to https

i have an ubuntu server running a plumber API, which provides a REST interface at http://myserver.com:8080/somecommand. I used systemd to host this (see https://www.rplumber.io/docs/hosting.html#systemd). I need, however, that this communication is…
hanshansen
  • 623
  • 5
  • 8
0
votes
1 answer

How to consume from API created in R Plumber when API runs in Docker Container?

I am trying to create a demo which is based on 2 docker containers. Each container runs R-Studio (rocker/verse). One container is publishing API and another container reading the result using GET (inside ShinyApp). When I test API in Swagger…
vlad1490
  • 355
  • 2
  • 8
0
votes
2 answers

How can i Merge/Summaries two JSON array into one based on one key variable in R?

I have some JSON arrays as - "expenseRecords": [ { "date_expensed": "2019-04-01", "exp_cat_description": "Air Travel", "totalamountUSD": 10, "totalRecords": 2 }, { "date_expensed": "2019-04-01", …
0
votes
2 answers

dplyr filter not working as expected in function with same argument names

I wrote the following simple plumber api library(plumber) library(dplyr) #* @apiTitle TESTS API #* Returns json with filtered mtcars #* @param carb #* @param gear #* @get /test2 #* @serializer unboxedJSON function(carb,gear) { mtcars %>%…
Ignacio
  • 7,646
  • 16
  • 60
  • 113
0
votes
1 answer

Using 'new' in Plumber

I have a simple function in my Plumber API that looks like the following: library(methods) library(plumber) # Other functions... #' @param elist The list of events to process as a string #' @get /process process_events <- function(elist=""){ …
user1938803
  • 189
  • 2
  • 10
0
votes
1 answer

R - plumber, how to add a stop/quit condition to the run?

I have a small API, that I need to stop running if a certain time in the day is reached, say midnight for example, and then continue on to the rest of the program. And that independant from a call from a request. Beacause one could include a…
Parisa
  • 448
  • 5
  • 11