_params.yml
dfr: "setosa"
Roy Francis
October 8, 2023
In this parameterized report, code parameters are specified in an external yaml file named _params.yml
.
Text metadata is specified in an external yaml file named _metadata.yml
.
index.qmd
is this file. See code-tools icons at the top of this document to see the code.
The document is rendered in the following ways:
# uses default params declared in the qmd yaml
quarto render index.qmd
# uses params defined in _params.yml
quarto render index.qmd --execute-params _params.yml
# uses params defined in _params.yml and merges metadata from _metadata.yml
quarto render index.qmd --execute-params _params.yml --metadata-file _metadata.yml
This is a multiline block. the first part of the analysis. More information. bla bla.
The virginica species is subsetted from the data.
---
title: "Parameterized report"
description: "Report with parameterized text/code from external yaml"
author: "Roy Francis"
date: 08-Oct-2023
format:
html:
title-block-banner: true
code-tools: true
params:
dfr: virginica
metadata-files:
- _metadata.yml
---
In this parameterized report, code parameters are specified in an external yaml file named `_params.yml`.
```{bash}
#| eval: false
#| filename: _params.yml
dfr: "setosa"
```
Text metadata is specified in an external yaml file named `_metadata.yml`.
```{bash}
#| eval: false
#| filename: _metadata.yml
topic: "Topic A"
block: |
This is a multiline block. the first part of the **analysis**. More information. bla bla.
```
`index.qmd` is this file. See code-tools icons at the top of this document to see the code.
The document is rendered in the following ways:
```
# uses default params declared in the qmd yaml
quarto render index.qmd
# uses params defined in _params.yml
quarto render index.qmd --execute-params _params.yml
# uses params defined in _params.yml and merges metadata from _metadata.yml
quarto render index.qmd --execute-params _params.yml --metadata-file _metadata.yml
```
## {{< meta topic >}}
{{< meta block >}}
The `r params$dfr` species is subsetted from the data.
```{r}
#| filename: R
head(subset(iris, iris$Species == params$dfr))
```