rstudio / rmarkdown-cookbook

R Markdown Cookbook. A range of tips and tricks to make better use of R Markdown.
https://bookdown.org/yihui/rmarkdown-cookbook/
584 stars 225 forks source link

Update recipe to include file content in a chunk #362

Closed cderv closed 2 years ago

cderv commented 2 years ago

The recipe is this one https://bookdown.org/yihui/rmarkdown-cookbook/option-code.html

When available in next version of knitr following https://github.com/yihui/knitr/commit/545aed32274955be2109150ce1ef4e24fe3732de

```{r, code=xfun::read_utf8('your-script.R')}

could be written

````markdown
```{r, file='your-script.R'}


This also relates to #360 as it will impact the syntax
yihui commented 2 years ago

I just updated this section. But the cairoDevice package has been archived on CRAN, so GHA failed: https://github.com/yihui/rmarkdown-cookbook/runs/4723294557?check_suite_focus=true (Update: I just removed the soft dependency on cairoDevice).

cderv commented 2 years ago

Thank you !