Skip to content
R for the Rest of Us Logo

Parameterized Reporting with RMarkdown

David Keyes David Keyes
October 15th, 2020

Have you ever had to make a set of reports that all look alike? Perhaps you're making one report for each school in your district. Doing this manually is, I probably don't need to tell you, a huge pain. Fortunately, R has a solution to this problem: parameterized reporting.

Parameterized reporting is a feature of RMarkdown that allows you to design a single report template and then use it to generate tens, hundreds, even thousands of reports at the same time.

When I was starting to learn R, I was so excited when I learned about parameterized reporting, but I quickly became frustrated when I tried (and failed) to implement it. There are resources out there, but I needed someone to walk me through the process step by step.

So, for the inaugural R for the Rest of Us office hours session, I did just that. After receiving multiple questions on parameterized reporting over the years, I gathered my thoughts and walked through exactly how it works.

The video below is 45 minutes, but if you watch it and learn to use parameterized reporting, I guarantee it will save you hours of work. May you never have to manually produce reports again!

Let us know what you think by adding a comment below.

You need to be signed-in to comment on this post. Login.

Alberto Cabrera

Alberto Cabrera

November 13, 2023

Your lecture clearly explains how to use R script to trigger a markdown report. Render works as a bridge linking the markdown program (input), the outcome(report file) and the parameter that is the key. Thanks for sharing your thought process aloud. It made me see the way R works better. In a future revision of “Parameterized Reporting with R”, you may consider devoting more time illustrating your own package (multireport). It seems easier to use. Also, you might consider illustrating the example using Quarto instead of Markdown.