Web apps in R - To package or not to package?

quarto
R
web app
golem
Different approaches to developing web apps in R
Author

Christina Buelow

Published

April 19, 2024

Quarto ‘quick and dirty’ or {Golem} for longevity and complexity?

As expected in an open-source programming language, the app-making landscape in R seems to be in constant flux. Something newish that I’ve been finding useful lately is using Quarto’s ‘Dashboards with Shiny for R’ feature.

Quarto is very similar to Rmarkdown, but has a few additional features. One of them is the ability to embed R {shiny} apps. So you end up writing your app like you would a markdown doc - the context, ui, and server are all code chunks, and the text around those code chunks set’s up the UI. For example, normally in markdown we use # to delineate and navigate headers; in Quarto Shiny Dashboards, # are used to delineate pages, tab panels, etc.

I’ve found it’s great for proto-typing simple apps - you can get something up and running very quickly in Quarto’s ‘Dashboards with Shiny for R’. However, I think it could get unwieldy when you start building complex apps with modules etc. In that case, developing your {shiny} app as an R package with {golem} might be a better option. {golem} provides a great framework for engineering production grade shiny apps that are complex and can be easily maintained in the long-term.

I ended up turning the prototype app I built in Quarto’s ‘Dashboards with Shiny for R’ into an R package with {golem}. It took much longer than I expected, but much of that time was learning about R package development (which I had never done before) and {golem}.

In the end I think it was worth the extra time and effort streamline as an R package. But if you want to compare for yourself, find the protoype Quarto dashboard shiny here and the {golem} R package version here.

Curious to hear others’ experiences though - please get in touch.

Citation

BibTeX citation:
@online{buelow2024,
  author = {Buelow, Christina},
  title = {Web Apps in {R} - {To} Package or Not to Package?},
  pages = {undefined},
  date = {2024-04-19},
  url = {https://cabuelow.github.io/personal-website/posts/2024-04-19-app-pros-cons/},
  langid = {en}
}
For attribution, please cite this work as:
Buelow, Christina. 2024. “Web Apps in R - To Package or Not to Package?” April 19, 2024. https://cabuelow.github.io/personal-website/posts/2024-04-19-app-pros-cons/.