An introduction to Quarto and how it can help you write reproducible research
Using Quarto to write reports in many formats (HTML, PDF, Word, etc.)
How to use Quarto to write code
Why is reproducible research so important? 🤔
The reproducibility crisis
Reproducibility is the ability of an entire experiment or study to be duplicated, either by the same researcher or by someone else working independently
The reproducibility crisis is a term used to describe the inability of researchers to replicate the results of a study using the same data and methods
The crisis is not limited to data science, but it’s particularly acute in fields like psychology and medicine
The crisis is caused by a combination of factors, including poor experimental design, publication bias, and the use of p-values
Here we will focus on the role of code and data in reproducibility, which is the most relevant to us
Amy Cuddy demonstrating her theory of “power posing”. It could never be replicated. Ted Talk with 72 million views!
Usage: quarto
Version: 1.6.40
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.
---title: "Default"---## QuartoQuarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
---title:"ggplot2 demo" format: html: code-fold: true---## Meet QuartoQuarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.```{r}#| label: plot-penguins#| echo: false#| message: false#| warning: falselibrary(tidyverse)library(palmerpenguins)ggplot(penguins, aes(x = flipper_length_mm, y = bill_length_mm)) +geom_point(aes(color = species, shape = species)) +scale_color_manual(values = c("darkorange","purple","cyan4")) + labs( title = "Flipper and bill length", subtitle = "Dimensions for penguins at Palmer Station LTER", x = "Flipper length (mm)", y = "Bill length (mm)", color = "Penguin species", shape = "Penguin species" ) +theme_minimal()
Jupyter
---title: "Palmer Penguins Demo" format: html: code-fold: truejupyter: python3---## Meet QuartoQuarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.```{python}#| echo: false#| message: falseimport pandas as pdimport seaborn as sns from palmerpenguins import load_penguinssns.set_style('whitegrid')penguins = load_penguins()g = sns.lmplot(x="flipper_length_mm", y="body_mass_g", hue="species", height=7, data=penguins, palette=['#FF8C00','#159090','#A034F0']);g.set_xlabels('Flipper Length');g.set_ylabels('Body Mass');
Quarto tooling
quarto render my-projectquarto render file.qmdquarto render file.qmd --to pdfquarto render file.qmd --to html