Session 8–Parameterized Reporting
Source: Jadey Ryan
---
title: "Report on Life Expectancy"
format: html
execute:
echo: false
warning: false
message: false
---
YAML
---
title: "Report on Life Expectancy"
format: html
execute:
echo: false
warning: false
message: false
params:
country: Afghanistan
---
usethis
package with install.packages("usethis")
report.qmd
file and save it as report2.qmd
country
parameter in the YAML to be called continent
and set the default value to be “Asia”gapminder_filtered
data frame so that it filters to use the continent
parameter05:00
report2.qmd
file, use inline code to create a line that says “This report is on population in [CONTINENT] from 1952 to 2007.”05:00
render.R
is what I typically call it)quarto_render()
function from the quarto
package:quarto
package using install.packages("quarto")
render.R
file and save it as render2.R
report2.qmd
document using the quarto_render()
function05:00
quarto_render()
quarto_render()
:render2.R
file, add an execute_params
argument to the quarto_render()
function to render the report for AfricaAfrica.html
using the output_file
argument05:00
quarto_render()
quarto_render()
pwalk()
function from the purrr
package to render all reports:render2.R
file, create a vector called continents
that has all continents for which we want to make reports. Use the code below as a model.render2.R
file, create a tibble called reports
that has all of the data needed to render all reports. Use the code below as a model.render2.R
file, use the pwalk()
function from the purrr
package to render all reports. Use the code below as a model.