rstudio::conf(2022)
Building Production-Quality Shiny Applications
Eric Nantz
R is the standard-bearer for data analysis tooling
Not just providing another interface for data analysis
You are engineering an entire workflow
These principles can guide (future) you on the right path:
Code-Along 1: Using the {shinipsum}
package for rapid UI prototyping
… at least for production-quality apps!
Imagine your application is working great!
ggplot2
version 0.9.3
ggplot2
version 1.0.0
{renv}
Create reproducible environments for your R projects.
{packrat}
Upon initializing a project:
.Rprofile
to activate custom package library on startuprenv.lock
to describe state of project libraryrenv/library
to hold private project libraryrenv/activate.R
performs activationSticking with {renv}
will pay off (trust me)
app.R
Prototype apps can coast by with a single app.R
app.R
almost explodesR
DirectoryR
directory{golem}
Opinionated framework for building production-grade Shiny applications as R packages
{usethis}
& {devtools}
Code-Along 2: Create a new Shiny application using the {golem}
framework
::: footer engineering-shiny.org
{rhino}
Create Shiny apps using software engineering best practices and development tools
{box}
for importing functions{renv}
for package managementCode-Along 3: Create a new Shiny application using the {rhino}
framework
{shinytest2}
{shinytest2}
provides a streamlined toolkit for unit testing Shiny applications
{shinytest}
{testthat}
, used widely in package development{chromote}
to render applications in a headless Chrome browser