Parameterized plots and reports with R and Quarto

Quarto
R
Data Visualisation
After running the ‘Parameterized plots and reports with R and Quarto’ workshop as part of the R/Pharma 2024 Conference, there were a few questions that we didn’t get the chance to answer. This blog post aims to answer some of them.
Author

Nicola Rennie

Published

October 28, 2024

Last week I ran a workshop on Parameterized plots and reports with R and Quarto as part of the R/Pharma conference, which I thoroughly enjoyed! There were lots of interesting questions from attendees during the workshop, some of which we didn’t quite have time to get to during the workshop. So this blog post will attempt to answer those questions, alongside highlighting some interesting tips and other frequently asked questions.

The workshop materials (including slides, examples, exercise solutions, and links to other resources) can be found on the workshop website.

Additional resources

There are many excellent resources available on parameterised plots and documents, and I’ll highlight just a few here. The links to these resources can also be found on the workshop website.

  • The R for Data Science book has a section on functions which you might find useful if you’re newer to writing your own functions for parameterizing plots or tables.

  • The Quarto documentation is excellent and has a section on document parameters which includes some examples.

  • The materials and recording from Cara Thompson’s talk at R/Medicine 2024 are available on her website. She discusseds how to create and refine a parameterised plot function!

  • Mandy Norrbo wrote a blog post to create parameterised revealjs presentations using Quarto. It also shows you how to create multiple reports for every combination of parameter values that you have.

  • During the workshop, I talked about combining parameters with conditional content. I previously written a blog post about how I use both to create tutorial worksheets for students.

Keep an eye on the R/Pharma YouTube channel for the recording which will be shared in a few months!

Thank you to the R/Pharma conference team for the invitation to present this workshop, and especially to Phil Bowsher and Libby Heeran (and many others) for your help in answering questions on the day!

Reuse

Citation

BibTeX citation:
@online{rennie2024,
  author = {Rennie, Nicola},
  title = {Parameterized Plots and Reports with {R} and {Quarto}},
  date = {2024-10-28},
  url = {https://nrennie.rbind.io/blog/parameterized-plots-reports-r-quarto/},
  langid = {en}
}
For attribution, please cite this work as:
Rennie, Nicola. 2024. “Parameterized Plots and Reports with R and Quarto.” October 28, 2024. https://nrennie.rbind.io/blog/parameterized-plots-reports-r-quarto/.