Skip to content
Discussion options

You must be logged in to vote

Quarto documents are simple flat text files.

Simply write the file with whatever you like in R.

cat(sprintf(
'---
title: "Some title"
date: 09/01/2014
doi: %s
---

## Important links

- [Article](https://doi.org/{{< meta doi >}})

## DAG

```{r}
dag <- dagitty::dagitty(%s)
tidy_dag <- ggdag::tidy_dagitty(dag)

ggdag::ggdag_status(tidy_dag) +
  ggdag::theme_dag()
```
',
doi_from_file,
dag_from_file
), file = 'index.qmd')
quarto::quarto_render("index.qmd")

Or create a template document that you can reuse (see https://quarto.org/docs/computations/parameters.html):

---
params:
  doi: none
  dag: none
title: "Some title"
date: 09/01/2014
doi: '{{< meta params.doi >}}'
---

## Important links

…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mcanouil
Comment options

mcanouil May 1, 2023
Collaborator

Answer selected by lorenzoFabbri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants