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

How to deploy a Plumber docker that writes a log file?

Im trying to deploy a R Plumber test API as a docker container as my main goal is to successfully create a log file everytime the API processes a request. I have tested it locally and it works. Here are my test files: plumber.R # plumber.R # A…
Andres Mora
  • 1,040
  • 8
  • 16
2
votes
0 answers

Is there a way to supply a clean R session for every call to a plumber API in R?

I have access to a plumber API which handles some automatic pipelining workflows for me. However, every job runs on the same R session and I'm a bit concerned regarding different calls interfering with each other. Off to top of my head the wish is…
Patrick
  • 742
  • 7
  • 19
2
votes
0 answers

Plumber POST API under an Nginx reverse proxy returns a 404 error

There seems to be quite a bit floating around the internet about problems such as this, but nothing I have found and tried quite pertains to my particular issue. I had a functional Plumber api working in Nginx on Digital Ocean, alas when I installed…
2
votes
1 answer

purrr::map executes mapping function in different environments for named functions and formula functions

I'm developing a plumber API and need to serialize a custom S3 class. As part of defining a custom serializer, I map over a list of instances of the S3 class. I have implemented a S3 method for as.list so that I can pass objects that…
Marcus
  • 3,478
  • 1
  • 7
  • 16
2
votes
0 answers

R, httr, and an unstoppable error message

In summary, I'm finding that when running httr::POST against a plumber api, within an R.utils::withTimeout, the post is throwing an error message which can't be suppressed. The error message is: Error in .Call(R_curl_fetch_memory, enc2utf8(url),…
nolanp2
  • 51
  • 6
2
votes
1 answer

API Endpoints with R Plumber and Plotly Exception Error

Suppose the contents of my plumber.r file are as follows below. I can successfully test each endpoint by visiting the path using chrome and viewing the expected output except for the \plotly endpoint. When visiting that in my browser (i.e.,…
dhc
  • 625
  • 1
  • 6
  • 14
2
votes
0 answers

Run plumber API on multiple ports

I was wondering of there is a way to run a plumber API on multiple ports I tried this r <- plumb("my_ws.R") r$run(host = "0.0.0.0" , port = c(9595, 8585)) but I didn't work
elj96
  • 53
  • 3
2
votes
1 answer

How to transfer a PDF file using the Plumber API?

I have an API function that takes an input, obtains necessary data using that input, calls a .rmd file, and using that .rmd file produces a pdf file in a specified directory. I need the remaining part of my API to take the newly produced pdf file…
Alokin
  • 461
  • 1
  • 4
  • 22
2
votes
1 answer

Running plumber API on Docker container

I would like to run plumber API on Docker container. I tried the following two dockerfiles: The first Dockerfile FROM rstudio/plumber MAINTAINER Docker User RUN R -e "install.packages('broom')" RUN mkdir -p ~/application # copy…
user1700890
  • 7,144
  • 18
  • 87
  • 183
2
votes
3 answers

RPlumber API - returning data as CSV instead of JSON - works locally on mac, but not on ubuntu-16.04

We are using RPlumber to host an API, and our developers asked that the API endpoints provide data in a CSV format, rather than JSON. To handle this, we have the following: r_endpoints.R #* @get /test-endpoint-1 testEndpoint <- function(res) { …
Canovice
  • 9,012
  • 22
  • 93
  • 211
2
votes
0 answers

Using sf package within a plumber api -- sf::st_as_sf seems to be failing

I am trying to create an API with the plumber package that leverages the sf package. The following function takes the x/y coordinates of a location in California and checks which electric provider's territory the coordinates fall under using the…
BillPetti
  • 511
  • 2
  • 7
  • 14
2
votes
1 answer

Problem accessing or/and running R plumber API in Docker

I have some R plumber files working using RStudio, next step is via docker. The instruction source('R/to_run_api_shirin_docker.R') Starting server to listen on port 8000 don't work and gives the following run : $ docker run -p 8000:8000…
cbo
  • 1,664
  • 1
  • 12
  • 27
2
votes
0 answers

Error with Plumber API deployment in Digital Ocean via R | Authentication with ssh server failed

I am facing some issues with Plumber API deployment in Digital Ocean via R. Given below is the R code I executed in my desktop (in RStudio) after making the following configurations.. Created SSH key in my desktop(eg:via puTTYgen) Entered the…
mmohd
  • 21
  • 1
  • 3
2
votes
2 answers

Docker and Plumber issue with port forwarding

Im trying to expose my plumber server over Docker. I'm getting a log from plumber in RStudio that it's listening on my desired port. And swagger launches and runs fine (the API works ok via swagger in my browser connecting over the exposed port for…
Happy Machine
  • 987
  • 8
  • 30
2
votes
1 answer

Error trying to connect to a droplet in analogsea

The initial attempt was to use analogsea to create a droplet using do_provision, but it seems that the problem is that I just can't seem to get ssh working. I'm not sure if something is wrong with my DO account or something is wrong with my…
Caroline
  • 450
  • 1
  • 5
  • 15