R-Ladies Edinburgh
11 December 2023
Lecturer in Health Data Science at Lancaster University.
Academic background in statistics, and experience in data science consultancy.
Organiser of R-Ladies Lancaster.
Quarto is an open-source scientific and technical publishing system that allows you to combine text, images, code, plots, and tables in a fully-reproducible document. Quarto has support for multiple languages including R, Python, Julia, and Observable. It also works for a range of output formats such as PDFs, HTML documents, websites, presentations,…
That sounds a bit like R Markdown!
R Markdown isn’t going anywhere but…
Quarto has better multi-language support
More user-friendly
Better control of the output layouts
Within RStudio IDE: click Render (or Ctrl+Shift+K)
YAML header
Content
Text, links, images
Code, tables, plots
Equations, references
Documents: HTML, PDF, MS Word, Markdown
Presentations: Revealjs, PowerPoint, Beamer
Websites
Books
…
Code visibility options:
Figure options:
Output location:
Highlight code:
We can also include code inline, rather than as a separate chunk.
The total number of lemurs is `r sum(lemurs$n)`
.
The total number of lemurs is 21859.
Templates: github.com/quarto-journals
---
title: "A very cool title"
format: html
---
\begin{equation}
\hat{e}_i = Y_i - \hat{Y}_i
\end{equation}
\[\begin{equation} \hat{e}_i = Y_i - \hat{Y}_i \end{equation}\]
::: .columns
::: {.column width = "60%"}
The content for the first column goes here.
:::
::: {.column width = "40%"}
The content for the second column goes here.
:::
:::
```{dot}
graph G {
qmd -- Knitr;
qmd -- Jupyter;
Knitr -- md;
Jupyter -- md;
md -- pandoc;
pandoc -- HTML;
pandoc -- PDF;
pandoc -- Word;
pandoc -- more;
}
```
Documentation: quarto.org
GitHub Discussions: github.com/quarto-dev/quarto-cli/discussions
Intro Webinar: jthomasmock.github.io/quarto-2hr-webinar
Awesome Quarto List: github.com/mcanouil/awesome-quarto
Create a new Quarto HTML document and fill in the YAML options.
Insert a new R code block.
Load some data e.g. data("CO2")
and create a plot.
Render your document.
Change the code block options.
Edit the YAML options to create revealjs
slides instead.
Look at the Quarto documentation to view other YAML options for revealjs
slides.
Bonus: create a parameterised document!