```{r}
#| eval: true
library(dplyr)
mtcars %>%
group_by(cyl) %>%
summarize(mean = mean(mpg), .groups = "drop")
```
# A tibble: 3 × 2
cyl mean
<dbl> <dbl>
1 4 26.7
2 6 19.7
3 8 15.1
R Foundations Course
November 16, 2023
These slides are almost entirely copied from Tom Mock’s ‘Getting Started with Quarto’ workshop at rstudio::conf(2022).
Shared under Creative Commons 4.0 License.
Quarto® is an open-source scientific and technical publishing system built on Pandoc
You can weave together narrative text and code to produce elegantly formatted output as documents, web pages, blog posts, books and more.
Quarto is the next generation of R Markdown. For everyone.
Quarto is a command line interface (CLI) that renders plain text formats (
.qmd
,.rmd
,.md
) OR mixed formats (.ipynb
/Jupyter notebook) into static PDF/Word/HTML reports, books, websites, presentations and more
knitr
We learned from 10 years of literate programming with knitr
+ rmarkdown
Works with R, Python, Julia, Observable JS
knitr
and jupyter
engines
Works in RStudio, Jupyter Notebooks, VS Code
For the R Foundations course, we’ll focus on R and RStudio
A Quarto document i.e. a
.qmd
is a plain text file, like a.rmd
, that can be rendered to many different formats
Quarto comes “batteries included” straight out of the box
revealjs
)See FAQs, including a conversion from RMarkdown formats to Quarto equivalents.
The YAML metadata or header is:
processed in many stages of the rendering process and can influence the final document in many different ways. It is placed at the very beginning of the document and is read by each of Pandoc, Quarto and
knitr
. Along the way, the information that it contains can affect the code, content, and the rendering process.
Quarto is based on Pandoc and uses its variation of markdown as its underlying document syntax. Pandoc markdown is an extended and slightly revised version of John Gruber’s Markdown syntax.
Markdown is a plain text format that is designed to be easy to write, and, even more importantly, easy to read
Markdown Syntax | Output |
---|---|
|
italics and bold |
|
superscript2 / subscript2 |
|
|
|
verbatim code |
Markdown Syntax | Output |
---|---|
|
Header 1 |
|
Header 2 |
|
Header 3 |
|
Header 4 |
|
Header 5 |
|
Header 6 |
You can embed named hyperlinks, direct urls like https://quarto.org/, and links to other places in the document. The syntax is similar for embedding an inline image:
Literate programming is writing out the program logic in a human language with included (separated by a primitive markup) code snippets and macros. - Wikipedia
“Yet Another Markup Language” or “YAML Ain’t Markup Language”
Then add option arguments!
format: html
```
r
) between curly braces {r}
#|
(hashpipe):
#| option1: value
---
title: Quarto
subtitle: R Foundations course
author: Ella Kaye | Department of Statistics | University of Warwick
title-slide-attributes:
data-background-color: "#552D62"
date: 2023-11-16
date-format: long
format:
revealjs:
theme: [default, ../../slides.scss]
slide-number: true
execute:
echo: true
---
Slidecraft 101 by Emil Hvitfeldt
Destination | Description |
---|---|
Quarto Pub | Publishing service for Quarto documents, websites, and books. |
GitHub Pages | Publish content based on source code managed within a GitHub repository. |
Posit Connect | Publishing platform for secure sharing of data products within an organization. |
Netlify | Professional web publishing platform. |
Confluence | Publishing platform for supporting team collaboration. |
… and more.
Visit https://quartopub.com/ and set up a free account.
quarto publish
At the Terminal, run:
https://quarto.org: The official documentation
Awesome Quarto: A curated list of Quarto talks, tools, examples & articles
These slides are almost entirely copied from Tom Mock’s ‘Getting Started with Quarto’ workshop at rstudio::conf(2022).
Shared under Creative Commons 4.0 License.
Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).