An R package that converts your existing R code to a web API using a handful of special one-line comments.
plumber allows you to create a REST API by merely decorating your existing R source code with special comments. Take a look at an example.
These comments allow plumber to make your R functions available as API endpoints. You can either prefix the comments with
#' but we recommend the former since
#' will conflict with the Roxygen package.
You can visit this URL using a browser or a terminal to run your R function and get the results. For instance http://localhost:8000/plot will show you a histogram, and http://localhost:8000/echo?msg=hello will echo back the ‘hello’ message you provided.
Here we’re using
curl via a Mac/Linux terminal.
As you might have guessed, the request’s query string parameters are forwarded to the R function as arguments (as character strings).
If you’re still interested, check out our more thorough documentation.
You can install the latest stable version from CRAN using the following command:
If you want to try out the latest development version, you can install it from GitHub. The easiest way to do that is by using