Creating a report with a parameter

Reporting with R Markdown

Amy Peterson

Head of Core Curriculum at DataCamp

Parameters

  • Create reports for different countries
  • Add inputs to the YAML header
Reporting with R Markdown

Adding a parameter

YAML header with country parameter and Indonesia

Reporting with R Markdown

Reviewing the code

Reviewing code chunk and object names for specific country references

Reporting with R Markdown

Reviewing the code

Replacing specific country references in code chunk and object names

Reporting with R Markdown

Reviewing the code

Reviewing code for country references

Reporting with R Markdown

Reviewing the code

Replacing specific countries in the code with the country parameter

Reporting with R Markdown

Reviewing the code

Reviewing ggplot2 code for specific country names in labels

Reporting with R Markdown

Reviewing the code

Removing country references in ggplot2 code

Reporting with R Markdown

Reviewing the text

 

Reviewing text for specific country references

Reporting with R Markdown

Reviewing the text

 

Replacing specific country references in text with the country parameter

Reporting with R Markdown

Reviewing the YAML header

YAML header with parameter

YAML header with parameter in title

Reporting with R Markdown

Knitting the report

Markdown file for Turkey

Knit file for Turkey

Reporting with R Markdown

Knitting a new report

Markdown file for Philippines

Knit file for Philippines

Reporting with R Markdown

Let's practice!

Reporting with R Markdown

Preparing Video For Download...