I worked on a refactor of an R package at work the other day. Here’s some notes about that after doing the work. This IS NOT a best practices post - it’s just a collection of thoughts.
For context, the package is an API client.
It made sense to break the work for any given exported function into the following components, as applicable depending on the endpoint being handled (some endpoints needed just a few lines of code, so those funtions were left unchanged):
tl;dr I implemented a todo backend in R with plumber. Use Rocker with PPAs for fast container builds. Dirk Eddelbuettel demonstrates how at this link. todo backend Todo-Backend is “a shared example to showcase backend tech stacks”, inspired by the front-end todomvc. It’s a good way to get a sense for how you might implement similar functionality in other languages. I’d read some other posts on setting up plumber apis so I decided to give it a shot.
Display Idiomatic Code to Construct Most R Objects
Prints code that can be used to recreate R objects. In a sense it is similar to base::dput() or base::deparse() but constructive strives to use idiomatic constructors.