Pre Work

Pre Work

  • Install latest version of RStudio
  • Install latest version of Quarto
  • Install these R packages:
#| eval: false
pkg_list <- c(
  "quarto", "rmarkdown", "kableExtra", "ggplot2", "dplyr"
  )
install.packages(pkg_list, repos="http://cran.us.r-project.org")

# fishi
devtools::install_github("OB7-IRD/fishi")

Great, let’s get started!

So what is Quarto?

Quarto® is an open-source scientific and technical publishing system built on Pandoc

So what is Quarto?

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

thomasmock$ quarto --help

  Usage:   quarto
  Version: 1.0.36

  Description:
    Quarto CLI

  Options:
    -h, --help     - Show this help.                            
    -V, --version  - Show the version number for this program.  

  Commands:
    render          [input] [args...]   - Render input file(s) to various document types.            
    preview         [file] [args...]    - Render and preview a document or website project.          
    serve           [input]             - Serve a Shiny interactive document.                        
    create-project  [dir]               - Create a project for rendering multiple documents          
    convert         <input>             - Convert documents to alternate representations.            
    pandoc          [args...]           - Run the version of Pandoc embedded within Quarto.          
    run             [script] [args...]  - Run a TypeScript, R, Python, or Lua script.                
    install         <type> [target]     - Installs an extension or global dependency.                
    publish         [provider] [path]   - Publish a document or project. Available providers include:
    check           [target]            - Verify correct functioning of Quarto installation.         
    help            [command]           - Show this help or the help of a sub-command.    

So what is Quarto?

Quarto, more than just knitr

So what is Quarto?

A Quarto document i.e. a .qmd is a plain text file, like a .rmd, that can be rendered to many different formats

A screenshot of a Visual and Source Quarto document

Many Quarto formats

  • RMarkdown grew into a large ecosystem, with varying syntax.

Quarto comes “batteries included” straight out of the box

  • HTML reports and websites
  • PDF reports
  • MS Office (Word, Powerpoint)
  • Presentations (Powerpoint, Beamer, revealjs)
  • Books
  • Any language, exact same approach and syntax

Many Quarto formats

Feature R Markdown Quarto
Basic Formats
Beamer
PowerPoint
HTML Slides
Advanced Layout

Many Quarto formats

Feature R Markdown Quarto
Cross References
Websites & Blogs
Books
Interactivity Shiny Documents
Journal Articles rticles
Dashboards flexdashboard

What to do with my existing .Rmd or .ipynb?

For some of you - nothing changes! Keep using RMarkdown and Jupyter.

However, most existing .rmd or .ipynb can be rendered as-is via Quarto

quarto render my-favorite.rmd --to html

Since Jupyter notebooks can either be treated as a linear document to be re-executed or an already evaluated document there are additional options like: --execute

quarto render my-favorite.ipynb --to html --execute

Quarto comes out of the box with much better accessibility, better defaults, more options, and a much more consistent syntax.

Summary of Quarto > RMarkdown

  • Easier to organize/structure document and document layout
  • Features largely cross-format
  • Better ability to integrate multiple languages in a PROJECT
  • Evaluate native language (R in knitr, Python/Julia in Jupyter)
  • HTML slides with revealjs are pandoc-compatible, so RStudio Visual Editor works with them