08:00
Session - quarto reporting
Scripts are very quick files of code with comments but RMarkdown and Quarto mix written text with code.
Quarto is a newer version of RMarkdown (2022) and is very similar for R users.
Quarto allows the possibility of working with colleagues who use other languages like Python.
Will open up a wizard to force the file to be saved.
As Quarto produces an output file it must have rights to save to the location.
Introduction code
and add a small table.View Pane
.08:00
The code sections in Quarto (and RMarkdown) are called chunks.
These are like smaller R scripts.
The default is for R chunks in R Studio but chunks can also be Python
Ctrl+Alt+i
/
and a drop down menu will appear, R chunk is the first so press ReturnEach chunk
is a part of a longer script and needs to be run in order to render.
#| echo: true
Let’s try to show code in a report:
37 * 6
#| echo: false
under the {r}
and Rendertrue
and RenderExtra time: Add another line for #| eval: false
,
Render, change to true
and Render
07:00
The default {r} settings are for echo: true
and eval: true
.
To switch these globally in YAML (yet another markup language) use execute and set the options to false
To create an html output that can be emailed without a folder with images and libraries:
Code can be added to the YAML to create an interactive table of contents (in html)
Note that spaces in the YAML matter!
Chunks can be named which makes them easier to navigate from the bottom left hand menu in the Editor.
#| label: my-chunk-name
A headers outline can be switched on/off from the Outline icon in the top right of the Editor pane.