TidyX 94: RMarkdown Parameterized Reports

This week, Ellis Hughes and I discuss how you can add controls to your RMarkdown by setting the parameters arguments within the YAML.

If you have a custom report that you need to reproduce frequently, changing different groups or pieces of information, parameterized reports are a great way to save time and ensure reproducibility.

For example, say you work for an NBA team and the head coach wants to see a team report on the Miami Heat, Dallas Mavericks, and Phoenix Suns. Rather than changing the contents within the RMarkdown itself (copying and pasting the new team name, seasons, weeks of year, etc.), which opens you up to making errors, you can set specific parameters that you want to exert control over within the YAML. Once you Knit the document with those parameters you can make the changes you need (IE, select the team, season, and weeks of the year) and the report will be produced with the desired info.

To watch our screen cast, CLICK HERE.

To access our code, CLICK HERE.