R Markdown compatibility #4026
-
I'm having difficulties trying to move from R Markdown to Quarto when rendering GitHub Markdown documents. I can't see how to set up the global variables
Using Quarto, There is no global variable like Is there way to do that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
First thing is that you can still use the same setup chunk as you have in R Markdown. It should just work without any transformation. Knitr option can be set this way. Example---
format: gfm
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "docs/source/_static/README-",
out.width = "100%"
)
```
# Readme
```{r}
1 + 1
```
A figure
```{r}
plot(cars)
```
Regarding a more Quarto way for this, you can set global knitr option in YAML now - see https://quarto.org/docs/computations/execution-options.html#knitr-options Example---
format: gfm
knitr:
opts_chunk:
collapse: true
comment: #>
fig.path: "docs/source/_static/README-"
out.width: "100%"
---
# Readme
```{r}
1 + 1
```
A figure
```{r}
plot(cars)
``` Can you try the above ? and can you share what is not working for you so that we can have a look ? |
Beta Was this translation helpful? Give feedback.
First thing is that you can still use the same setup chunk as you have in R Markdown. It should just work without any transformation. Knitr option can be set this way.
Example
Regarding a more Quarto way for this, you can set global knitr option in YAML now - see https://quarto.org/docs/computations/execution-options.html#knitr-options
Example