Getting Started with Quarto for Data Science Reports

Quarto
Tutorial
Reproducibility
A beginner’s guide to creating beautiful, reproducible reports using Quarto in your data science workflow.
Author

Antoine Lucas

Published

July 10, 2024

What is Quarto?

Quarto is an open-source scientific and technical publishing system that lets you create:

  • Documents (HTML, PDF, Word)
  • Presentations
  • Websites and blogs
  • Books

It supports multiple programming languages including R, Python, Julia, and Observable.

Getting Started

Installation

Download Quarto from quarto.org.

Your First Quarto Document

Create a file named report.qmd:

---
title: "My First Report"
author: "Antoine Lucas"
date: today
format: html
---

## Introduction

This is my first Quarto document.

```{r}
library(ggplot2)
ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point() +
  labs(title = "Car Weight vs. Fuel Efficiency")
```

Rendering

quarto render report.qmd

Key Features

Code Execution Options

#| echo: true      # Show the code
#| eval: true      # Run the code
#| warning: false  # Hide warnings
#| fig-width: 8    # Figure width
#| fig-height: 6   # Figure height

Cross-References

Reference figures, tables, and sections:

See @fig-scatter for the visualization.

```{r}
#| label: fig-scatter
#| fig-cap: "Scatter plot of weight vs mpg"
ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point()

```

Callouts

Note

This is a note callout for additional information.

Warning

This is a warning callout for important caveats.

Benefits for Data Science

  1. Single source of truth — Code and narrative together
  2. Multiple output formats — One document, many formats
  3. Reproducibility — Anyone can re-run your analysis
  4. Version control friendly — Plain text format works well with Git

Conclusion

Quarto is an excellent tool for creating reproducible data science reports. Start with simple documents and gradually explore its advanced features.

Resources

Back to top