Porcelain helps convert R packages into easily-tested APIs, using plumber
. The ideas come from our experience putting complex R APIs into production where it is important that the API behaves predictably even with unpredictable inputs.
The focus of plumber
is quickly putting together applications and works like magic. In porcelain
we take a more explicit approach defining standard response types and using schemas to make clear the API contract.
While a work-in-progress, we use this in several applications:
orderly.server
which asynchronously runsorderly
reportshintr
which runs statistical analysis of HIV prevalence under interventions (see the project page for more information).mintr
which is a simpler application looking at interventions for malaria control. for The application is publicly availablecometr
which runs dynamic models of COVID-19
Each of these applications is used by web applications written in Kotlin/TypeScript - see this poster for more on our design approach.
For more information, see the package vignettes:
vignette("porcelain")
- an introduction and example packagevignette("cookbook")
- a cookbook of endpoint patterns
MIT © Imperial College of Science, Technology and Medicine