Introduction to plumber
Plumber is an R package that helps in translating R functions into an HTTP API that can be invoked from other machines within a network, enabling communication between systems. By using R plumber, we will be able to achieve the advantages discussed, such as developing modularized, language agnostic, common communication language (JSON) based HTTP rest APIs that provide a defined path of communication between systems. Using plumber is extremely straightforward. With a few lines of code, we can convert our existing R functions into a web service that can be served as an endpoint.
In this chapter, we will extend the same model and use case we built in Chapter 7, Model Improvements, to classify whether a patient is diabetic using the PimaIndiasDiabetes dataset in the mlbench library. Later, we will extend the same use case to deploy the model as a web service using a Docker container and serverless applications.