Streamline reporting

Reproducible reports with Quarto

John Little

Duke University Libraries

Center for Data & Visualization Sciences

2024-10-16

What is reproducibility?


Recreate the exact results of a computational analysis or experiment using the same data, code, and methods as the original study.


Someone else should be able to follow the same steps and obtain the same outcomes.


CDVS Youtube

What is workflow

A structured sequence of data processing, analysis, and computational steps used to transform raw data into meaningful results or insights.

Typically involves:

  • Data acquisition and preparation
  • Processing and analysis steps
  • Generation of outputs (e.g., results, visualizations)
  • Documentation of the process
Automated and Reproducible

Quarto

Quarto is a scientific publishing system that enables reproducible workflows and simplifies report generation.


Quarto uses notebooks as the primary document format.


RStudio and Quarto were introduced and discussed in previous sessions.


Get Started text with videosExercises, code, slides

Notebooks


A notebook is a document containing code and natural language

  • Jupyter (.ipynb)
  • Quarto document (.qmd) (next-gen R Markdown)

Quarto Notebook in RStudio

What we’ll learn

Streamlining reproducible workflows - from code to reports (slides, PDF, dahsboards, etc.) that enable reproducible workflows and simplify generating reports from code.


Take control of your reports and can reduce dependencies on subscription hosts.

RStudio configurations

Prerequisites

  • Already installed tinytex on Windows via Terminal (takes several minutes)
    • Rstudio > Terminal > quarto install tinytex
  • Use RStudio Project protocol
    • Use git version control (next week)
    • Use {renv} to back-up specific package versions
    • Use GitHub to manage versions
    • Link GitHub to Zenodo to mint DOIs and archive milestones (Instructions)

Prequeisites . . .


Bibliography


Quarto leverages bib files from from bibliographic reference managers (Zotero, EndNote) and imports relevant citation data from DOIs

  • references.bib - bibliography file

SHOW

Clone example from GitHub

More information:

Hands-on

Create a Quarto webSite

RStudio: File > New Project > New Directory > Quarto Website

Create a Quarto Manuscript

RStudio: File > New Project > New Directory > Quarto Manuscript

Or, follow these directions from Çetinkaya-Rundel & Wickham

Dashboards

Dashboards: Just like a standard quarto document (docs). YAML -> format: dashboard

  • Interactivity
    • Simple interactivity with HTML Widgets
    • Advanced interactivity with Shiny (server-side) and Observable (client-side)

More tips