Rendering multiple reports

Session - using Quarto Projects

Zoë Turner

Rendering as you save

Using the button on the RStudio panel (under the tabs)

Whenever you save this updates the document

Cloud default settings are different!

On a computer the default

Global Options.../Code/Saving/Automatically save when editor loses focus

is not ticked which allows for the Render on Save function. On Posit Cloud it is ticked.

Combining features in RStudio

The settings in the cog (next to Render) include:

  • Preview in View Pane which opens a Viewer pane within RStudio
  • Chunk output Inline is within the current screen but there is the option to only have output appear in the Console.

Rendering from the R Console

Using the {quarto} package the following renders everything in the project

```{r}
quarto::quarto_render()
```

Quarto project

  • This command will only work if the project is a Quarto Project
  • This requires a file called _quarto.yml and can start off with just the code:
project:
  title: "intro-quarto"

Rendering from the Terminal

Where the prompt is $ commands can be used for git and also quarto:

quarto render

Adding more to the _quarto.yml

If there are several files using the same YAML information this can be put into the _quarto.yml file so it only has to be written once:

project:
  title: "intro-quarto"
author: "Zoë Turner"
execute: 
  echo: false
  eval: false
embed-resources: true

Excluding files

The _quarto.yml can be used to list specific files to render or, alternatively, have files to exclude:

project:
  title: "intro-quarto"
  render: 
    - "*.qmd"
    - "!*.md"
    - "!folder-example/"

This includes anything with a .qmd ending but not a .md and not for files that are in a folder called folder-example/ger

Next Section