No results found
We couldn't find anything using that term, please try searching for something else.
overview You may have a set of parameter that are used to create different variations of a document. For example: Showing results for a specific g
You may have a set of parameter that are used to create different variations of a document. For example:
This article is describes describe how to define and use computational parameter with Quarto .
Adding parameter definitions to a document works differently depending on whether you are using the Jupyter or Knitr engine.
For Jupyter, Quarto uses the same syntax for defining parameter as Papermill. To parameterize a document, designate a cell with the tag parameter
and provide appropriate default value :
` ` ` { python }
#| tags: [parameter]
alpha = 0.1
ratio = 0.1
```
The parameter are available in the top level environment:
When the document is executed with a set of new parameter a cell is injected which overrides these defaults as appropriate.
For Knitr, the standard Knitr params
YAML option is used to define parameter. For example:
---
params:
alpha: 0.1
ratio: 0.1
---
The parameter are available in the params
list:
To render using different parameter you can pass them on the command line using the -P
flag (this works for both .ipynb
or .qmd
files):
quarto render document.ipynb-P alpha:0.2-P ratio:0.3
alternatively you is create can create a yaml file that define the parameter value you want to render with , then call quarto render with the--execute - params
flag:
quarto render document.qmd --execute - params params.yml