Reproducible publishing with Quarto
Duke University
Posit, PBC
Posit, PBC
2024-08-04
Option 1: (Cloud - Recommended)
Go to https://bit.ly/quarto-jsm24-cloud, create an account, and join the workspace.
Option 2: (Local)
Download and install the latest versions of R, RStudio, and Quarto:
4.4.1
or above: https://cran.r-project.org2024.04.2+764
or above: https://posit.co/download/rstudio-desktop1.5.56
: https://quarto.org/docs/get-startedInstall the following packages:
Download exercises.zip
at and unzip it on your Desktop or somewhere you can easily locate on your computer.
WiFi: JSM2024 / Password: abbvie24
Exits: 2 in the back, 1 in the front of the room
Restrooms: Out the hallway, to the right
The American Statistical Association (ASA) is committed to providing an atmosphere in which personal respect and intellectual growth are valued and the free expression and exchange of ideas are encouraged. Consistent with this commitment, it is the policy of the ASA that all participants in ASA activities enjoy a welcoming environment free from unlawful discrimination, harassment, and retaliation. We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to, members of any race, ethnicity, culture, national origin, color, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
Model and support the norms of respect necessary to promote the conditions for healthy exchange of scientific ideas.
In speech or conduct, do not insult or disparage other participants.
Be conscious of hierarchical structures, specifically the existence of stark power differentials between students, early career statisticians and established career statisticians—noting that fear of retaliation from more established statisticians can make it difficult for students and early career statisticians to express discomfort, rebuff unwelcome advances, and report violations of the conduct policy.
Be sensitive to indications that may suggest that individuals are feeling unwelcome.
Mine Çetinkaya-Rundel
Professor of the Practice, Department of Statistical Science, Duke University
Developer Educator, Posit
R Markdown user/educators for 10+ years
Quarto user/educators for 3+ years
Please share with the person next to you…
03:00
My turn
Our turn
Your turn
Time | Module |
---|---|
08:30 - 10:15 | From R Markdown to Quarto |
10:15 - 10:30 | Break |
10:30 - 12:30 | Creating computational documents and slides with Quarto |
12:30 - 14:00 | Lunch |
14:00 - 15:15 | Creating websites and books with Quarto |
15:15 - 15:30 | Break |
15:30 - 17:00 | Authoring manuscripts with Quarto |
Just raise your hand!
I’ll assume you
know some R
have worked in RStudio
want to learn about Quarto
I’ll teach you
Quarto syntax and formats
More Markdown
Even more R along the way!
Have you completed the following?
Option 1: (Cloud - Recommended)
Go to https://bit.ly/quarto-jsm24-cloud, create an account, and join the workspace.
Option 2: (Local)
Download and install the latest versions of R, RStudio, and Quarto:
4.4.1
or above: https://cran.r-project.org2024.04.2+764
or above: https://posit.co/download/rstudio-desktop1.5.56
: https://quarto.org/docs/get-startedInstall the following packages:
Download exercises.zip
at and unzip it on your Desktop or somewhere you can easily locate on your computer.
Let’s get started!
With Quarto you can weave together narrative text and code to produce elegantly formatted output as documents, web pages, blog posts, books and more.
just like R Markdown…
but not just like it, there’s more to it…
unifies + extends the R Markdown ecosystem
unifies + extends the R Markdown ecosystem
unifies for people who love R Markdown
unifies + extends the R Markdown ecosystem
unifies for people who love R Markdown
extends for people who don’t know R Markdown
Sit back and enjoy! … or follow along with hello-penguins.qmd
.
pdf
, docx
, revealjs
code-fold
, toc
echo
, warning
)Option 1: Start the project 1-rmarkdown-quarto
.
Option 2: Launch the project in 1-rmarkdown-quarto
.
hello-penguins.qmd
in RStudio and with the visual editor.05:00
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.
mine$ quarto --help
Usage: quarto
Version: 1.5.56
Description:
Quarto CLI
Options:
-h, --help - Show this help.
-V, --version - Show the version number for this program.
Commands:
render [input] [args...] - Render files or projects to various document types.
preview [file] [args...] - Render and preview a document or website project.
serve [input] - Serve a Shiny interactive document.
create [type] [commands...] - Create a Quarto project or extension
use <type> [target] - Automate document or project setup tasks.
add <extension> - Add an extension to this folder or project
update [target...] - Updates an extension or global dependency.
remove [target...] - Removes an extension.
convert <input> - Convert documents to alternate representations.
pandoc [args...] - Run the version of Pandoc embedded within Quarto.
typst [args...] - Run the version of Typst embedded within Quarto.
run [script] [args...] - Run a TypeScript, R, Python, or Lua script.
install [target...] - Installs a global dependency (TinyTex or Chromium).
uninstall [tool] - Removes an extension.
tools - Display the status of Quarto installed dependencies
publish [provider] [path] - Publish a document or project to a provider.
check [target] - Verify correct functioning of Quarto installation.
help [command] - Show this help or the help of a sub-command.
knitr
We learned from 10 years of literate programming with knitr
+ rmarkdown
knitr
knitr
knitr
or jupyter
evaluates R/Python/Julia code and returns a .md
file along with the evaluated code.md
file by Pandoc and converted to a final output formatRendering a Quarto file in RStudio via the Render button calls quarto render
in a background job, preventing Quarto rendering from cluttering up the R console, and gives you and easy way to stop:
quarto render
:Option 1: Start the project 1-rmarkdown-quarto
.
Option 2: Launch the project in 1-rmarkdown-quarto
.
quarto render
, andquarto::quarto_render()
.03:00
Quarto comes “batteries included” straight out of the box:
HTML reports and websites
PDF reports
MS Office (Word, Powerpoint)
Presentations (Powerpoint, Beamer, revealjs
)
Books
Manuscripts
…
Feature | Quarto |
---|---|
Basic Formats | html, pdf, docx, typst |
Beamer | beamer |
PowerPoint | pptx |
HTML Slides | revealjs |
Advanced Layout | Quarto Article Layout |
Cross References | Quarto Crossrefs |
Websites & Blogs | Quarto Websites, Quarto Blogs |
Books | Quarto Books |
Interactivity | Quarto Interactive Documents |
Journal Articles | Journal Articles |
Dashboards | Quarto Dashboards |
Option 1: Start the project 1-rmarkdown-quarto
.
Option 2: Launch the project in 1-rmarkdown-quarto
.
Go to File > New File > Quarto document to create a Quarto document with HTML output. Render the document, which will ask you to give it a name – you can use my-first-document.qmd
.
Use the visual editor for the next steps.
sketchy
.05:00
You can render existing R Markdown documents with Quarto and you can rename them to .qmd
files to turn them into Quarto documents.
You don’t have to do this – R Markdown continues to be maintained.
However, new features are being developed for Quarto.
Additionally, Quarto
Offers “batteries included” shared syntax across formats
Allows you to choose your own editor and your preferred data science language
Comes with richer and more accessible features out of the box
Is actively developed
Any questions / anything you’d like to review before we wrap up this module?
Where does the name “Quarto” come from?