Is there an equivalent in quarto::quarto_render()
to rmarkdown::render(params =)
? There's an execute_params
argument but can't seem to make it work for that purpose:
For example, how can I pass custom parameters to the following .qmd
file using quarto_render()
?
```{r}
params$foo
```
execute_params
is the right argument, but relies on the parameter being set with a default value in the YAML. For example, if this is document.qmd
:
---
title: "Untitled"
format: html
params:
foo: 3
---
```{r}
params$foo
```
This will work:
quarto::quarto_render("document.qmd", execute_params = list(foo = 5))
And you'll correctly get output:
params$foo
[1] 5