class: center, middle, inverse, title-slide # Reproducible research workflows for psychologists ##
Introduction to RMarkdown
###
Johannes Breuer & Frederik Aust ###
KU Leuven, 27.-28.04.2022
--- exclude: true --- # Dynamic documents Dynamic documents are derived from the concept of [literate programming](https://en.wikipedia.org/wiki/Literate_programming). They fuse computer code and documentation and results are embedded directly into the document. --- # Dynamic documents Dynamic documents can be a partial solution to the challenge of computational reproducibility (same data, same code, same results). They can prevent transcription errors and ensure that statistics, tables, and figures represent the current analytic approach. -- One solution for producing dynamic documents is `R Markdown`. --- # What is `R Markdown`? >R Markdown provides an unified authoring framework for data science, .highlight[combining your code, its results, and your prose commentary]. R Markdown documents are .highlight[fully reproducible] and .highlight[support dozens of output formats], like PDFs, Word files, slideshows, and more ([R for Data Science](https://r4ds.had.co.nz/r-markdown.html)). --- # What is `R Markdown`? `R Markdown` is... - an authoring framework -- - a document format (`.Rmd`) -- - an [`R` package](https://github.com/rstudio/rmarkdown) --- # What is `R Markdown`? ## [Markdown](https://en.wikipedia.org/wiki/Markdown) + `R` TL;DR of the *Wikipedia* article: `Markdown` is a lightweight markup language for text formatting. --- # What does `R Markdown` do? <img src="data:image/png;base64,#./img/rmarkdown_rockstar.png" width="75%" style="display: block; margin: auto;" /> <small><small>[Artwork](https://github.com/allisonhorst/stats-Artworks) by [@allison_horst](https://twitter.com/allison_horst)</small></small> --- # `R Markdown` and reproducibility As it combines code, text, and outputs, `R Markdown` is a great tool for writing reproducible publications (papers, project reports, etc.). <img src="data:image/png;base64,#./img/reproducibility_court.png" width="70%" style="display: block; margin: auto;" /> <small><small>[Artwork](https://github.com/allisonhorst/stats-Artworks) by [@allison_horst](https://twitter.com/allison_horst)</small></small> --- # What can you do with `R Markdown`? .smaller[ In a nutshell, with `R Markdown` it is possible to generate **reproducible** dynamic documents which... - (can) include text, code, and output from that code - render to many different output formats, including: + `HTML` + `Markdown` + `PDF` + *Microsoft Word* + Open Document + `RTF` For a [full list of supported output formats](https://rmarkdown.rstudio.com/docs/reference/index.html#section-output-formats) see the `rmarkdown` package documentation. ] --- # What can you do with `R Markdown`? .small[ There are quite a few packages that offer extension output formats for `R Markdown`. For example: - [`xaringan`](https://github.com/yihui/xaringan) for presentations---which is what we use for our slides - [`bookdown`](https://bookdown.org/) for books (but also for websites) - [`blogdown`](https://bookdown.org/yihui/blogdown/) for websites - [`vitae`](https://github.com/mitchelloharawild/vitae) for (data-based) Résumés and CVs - [`posterdown`](https://github.com/brentthorne/posterdown) for academic (conference) posters - [`flexdashboard`](https://rmarkdown.rstudio.com/flexdashboard/index.html) for interactive dashboards ... and there are many more. ] --- # `R Markdown` and versatility <img src="data:image/png;base64,#./img/rmarkdown_formats.png" width="70%" style="display: block; margin: auto;" /> --- # Disclaimer: What we will cover Covering everything you can do with `R Markdown` or even exploring all options for specific kinds of outputs, such as presentations or scientific publications, in-depth would be enough for separate workshops. Hence, this session will only cover the basics of `R Markdown`. -- In the next session, we will discuss reference management with `R Markdown` and dive into the possibilities offered by the package [`papaja`](https://github.com/crsh/papaja) which can be used to prepare APA Journal Articles with `R Markdown`. --- # Getting started with `R Markdown` If you use *RStudio* you only need to install the `R Markdown` package: ```r install.packages("rmarkdown") ``` *Note*: If you do not have *RStudio* installed, you also need to [install Pandoc](https://pandoc.org/installing.html). --- # PDF output with `R Markdown` If you want to generate PDF output with `R Markdown`, you need `\(\LaTeX\)`. If you have a `\(\LaTeX\)` distribution like [`MiKTeX`](https://miktex.org/) or [`TeX Live`](https://www.tug.org/texlive/) on your system, you should be all set. --- # PDF output with `R Markdown` If you do not have `\(\LaTeX\)` installed, the easiest option---especially if you do not want to use plain `\(\LaTeX\)`---is installing [`TinyTeX`](https://yihui.org/tinytex/), which is "a lightweight, cross-platform, portable, and easy-to-maintain LaTeX distribution based on TeX Live". You can do that using the [`tinytex` package](https://cran.r-project.org/web/packages/tinytex/index.html). It also takes care of installing missing `\(\LaTeX\)` packages on the fly when knitting documents. ```r install.packages('tinytex') tinytex::install_tinytex() ``` <!-- *Note*: You can also install `\(\LaTeX\)` packages manually using the `tlmgr_install()` function from the `tinytex` package. --> --- # Getting started with `R Markdown` You can create a new `R Markdown` document in *RStudio* via *File* -> *New File* -> *R Markdown* in the menu. This will open a new window in which you can set the author name and title and pick an output format for your document. <img src="data:image/png;base64,#./img/create_rmarkdown_menu.png" width="40%" style="display: block; margin: auto;" /> --- # Ingredients 🍲 `R Markdown` documents are two-part plain text documents 1. YAML front matter - Document metadata - Rendering options 2. Document body - `Markdown` text - `R` code --- # Anatomy of an `R Markdown` document <img src="data:image/png;base64,#./img/rmarkdown_example_annotated.png" width="60%" style="display: block; margin: auto;" /> --- # YAML header ```yaml --- title: "My First R Markdown Document" subtitle: "A first in the series of many more to come" author: "Gordon Shamway" date: "27-04-2022" output: html_document --- ``` .small[ [YAML](https://yaml.org/) stands for "YAML Ain't Markup Language" (formerly known as "Yet Another Markup Language"). The YAML header in `R Markdown` documents contains metadata for the document. It provides human-readable configuration information and can include a large variety of key:values-pairs to specify what the document should look like. It needs to be at the beginning of the document and start and end with `---`. <!-- *Note*: There is an `R` package called [`ymlthis`](https://ymlthis.r-lib.org/) for creating extended YAML headers in and with `R`. --> ] --- # YAML header `YAML` data structures translate to `list` objects in `R` .pull-left-45[ ```yaml --- title: "My First R Markdown Document" author: "Gordon Shamway" date: "27 04 2022" output: html_document --- ``` ] .pull-right-45[ ``` ## List of 4 ## $ title : chr "My First R Markdown Document" ## $ author: chr "Gordon Shamway" ## $ date : chr "27 04 2022" ## $ output: chr "html_document" ``` ] --- # YAML header Indentations denote the nesting structure of a `list` .pull-left-45[ ```yaml output: html_document: toc: yes ``` ] .pull-right-45[ ``` ## List of 1 ## $ output:List of 1 ## ..$ html_document:List of 1 ## .. ..$ toc: logi TRUE ``` ] <br /><br /><br /><br /> -- `toc` is nested in `html_document` (i.e., it is an argument to that output function) --- # YAML header Similarly, it is possible to specify vectors. ```yaml bibliography: ["references.bib", "r-pkg-references.bib"] ``` ``` ## List of 1 ## $ bibliography: chr [1:2] "references.bib" "r-pkg-references.bib" ``` *Note*: We will cover how to manage references in `R Markdown` in the next session. --- # YAML header Text that spans multiple lines can be declared with `|` ```yaml abstract: | This text spanns multiple rows. New lines are preserved, but note the indentation! ``` *Note:* All lines must be indented! --- # YAML header You can also use the `YAML` front matter to customize the appearance of the resulting documents. For example, you can specify that you want a table of contents (TOC), how many levels that should have, or whether sections should be numbered. --- # YAML header & `\(\LaTeX\)` If you want to use `R Markdown` to generate PDF output via `\(\LaTeX\)`, you can make use of additional options in the `YAML` header, e.g., for loading additional `\(\LaTeX\)` packages or specifying a different `\(\LaTeX\)` engine (by default `pdflatex` is used) or keeping the `.tex` file. --- # `(R) Markdown` text formatting While it is not necessary to know `Markdown` to use `R Markdown` (though if you want to know more, you can, e.g., check out the [Markdown Guide](https://www.markdownguide.org/) or this [interactive tutorial](https://commonmark.org/help/tutorial/)), it helps to know some of the basics of `Markdown` text formatting as they are the same for `R Markdown`. --- # Text formatting .pull-left[ ### Syntax ```txt *italics* **bold** ***bold & italics*** ~~strikethrough~~ ``` ] .pull-right[ ### Output *italics* <span style="font-weight:bold;">bold</span> <span style="font-weight:bold;"><i>bold & italics</i></span> ~~strikethrough~~ ] --- # Headers .pull-left[ ### Syntax ```txt # Header 1 ## Header 2 ### Header 3 ``` ] .pull-right[ ### Output # Header 1 ## Header 2 ### Header 3 ] --- # Paragraphs A new paragraph is started with a blank line before the text. **NB**: If you just hit Enter/Return to move text to a new line in an `R Markdown` document, the text you enter after that will not be on a new line in the output document. -- *Note*: When you generate `HTML` output, you can also use `HTML` commands in your `R Markdown` document. So, for example, you could insert an empty line with `<br>`. Likewise, when producing PDF output, you can use `\(\LaTeX\)` commands, such as `\newline` or `\newpage`. --- # Lists .pull-left[ ### Syntax ```markdown - unordered list + sub-item 1. ordered list 2. ordered list + sub-item + sub-item ``` ] .pull-right[ ### Output - unordered list - sub-item 1. ordered list 2. ordered list + sub-item + sub-item ] --- # Other formatting stuff .pull-left[ ### Syntax ```markdown `library(tidyverse)` [link](https://gesis.org) > block quote ![R Logo](./img/Rlogo.png) ``` ] .pull-right[ ### Output `library(tidyverse)` [link](https://gesis.org) > block quote <img src="data:image/png;base64,#./img/RLogo.png" width="20%" style="display: block; margin: auto;" /> ] --- # Other formatting stuff For more formatting options check out the [RMarkdown Reference Guide](https://rstudio.com/wp-content/uploads/2015/03/rmarkdown-reference.pdf) which is also available in *RStudio* via *Help* -> *Cheatsheets* -> *R Markdown Reference Guide*. --- # Code chunks <img src="data:image/png;base64,#./img/code_chunk.png" width="1287" style="display: block; margin: auto;" /> As the name says, code chunks in `R Markdown` documents include code. This is typically `R` code, but other languages are supported as well (e.g., `Python` or `SQL`). The code is executed when the file is knitted (we'll talk about what this means in a bit). --- # Code chunks You can insert a code chunk via the `Insert` button (select `R`) or using the keyboard shortcut <kbd>Ctrl + Alt + I</kbd> (*Windows* & *Linux*)/<kbd>Cmd + Option + I</kbd> (*Mac*). -- *Note*: It is possible to [render an `R` script into an `R Markdown` report](https://bookdown.org/yihui/rmarkdown-cookbook/spin.html) using `knitr::spin` and, vice versa, to [convert an `R Markdown` document to an `R` script](https://bookdown.org/yihui/rmarkdown-cookbook/purl.html) via `knitr::purl()`. --- # Code chunks It is good practice to name code chunks. In the example on the previous slide `{r cars}` specifies the language for the code `r` and a name `cars`. By naming code chunks it is, e.g., possible to reference them in other code chunks and they will also appear in the interactive ToC at the bottom of the tab for the `R Markdown` document. *Chunk names may never be used twice in a single document and should not include spaces or underscores.* --- # Chunk options <img src="data:image/png;base64,#./img/code_chunk_options.png" width="1281" style="display: block; margin: auto;" /> You can also set a variety of options for code chunks. In the above example, we set `echo = FALSE` which means that the code itself will not be displayed in the output document (only its output). Other exemplary chunk options are `eval = FALSE`, meaning that the code is not executed, or `warning = FALSE` or `message = FALSE` which mean that warnings or messages produced by the code are not shown in the output document. Yihui Xie, the main author of the `knitr` package, keeps an [updated list of all code chunk options](https://yihui.org/knitr/options/). --- # Setup chunk <img src="data:image/png;base64,#./img/setup_chunk.png" width="1277" style="display: block; margin: auto;" /> It generally makes sense to include a setup chunk in your document (right after the YAML header). Here you can set global options for your code chunks (which can be overridden by setting options for individual chunks), general options for `R`, or already load packages. --- # Inline code <img src="data:image/png;base64,#./img/inline_code.png" width="1273" style="display: block; margin: auto;" /> It is also possible to execute code within text. That way, the output is automatically updated if it is compiled again after the input (usually the data) has changed. Inline code needs to be enclosed in backticks and has to start with a specification of the language (typically `r`) if the code should be executed when the document is compiled. Only the result(s) of the inline code (not the code itself) will be displayed in the output document. --- # Comments It is also possible to include comments in an `R Markdown` document that will not be displayed in the output. To comment something out, you can select it and use the keyboard shortcut <kbd>Ctrl + Shift + C</kbd> (*Windows* & *Linux*)/<kbd>Cmd + Shift + C</kbd> (*Mac*). A comment in `R Markdown` looks like this: `<!-- This is a comment -->` --- # Excursus: Tables in `R Markdown` As with many things in `R`, there are many options for creating tables that can be used with `R Markdown`. Discussing all of them would be too much for this workshop (but we will see some further examples in the session on `papaja`). An easy-to-use and quite versatile option is `knitr::kable()` which can be nicely extended using the [`kableExtra` package](https://haozhu233.github.io/kableExtra/). --- # Excursus: Tables in `R Markdown` ```r library(dplyr) # for wrangling library(gapminder) # for exemplary data library(kableExtra) # for table formatting gapminder |> filter(year == 2007, continent == "Europe") |> select(country, lifeExp, pop, gdpPercap) |> head(10) |> knitr::kable() |> kable_styling(bootstrap_options = c("striped", "hover", "condensed")) ``` --- # Excursus: Tables in `R Markdown` .small[ <table class="table table-striped table-hover table-condensed" style="margin-left: auto; margin-right: auto;"> <thead> <tr> <th style="text-align:left;"> country </th> <th style="text-align:right;"> lifeExp </th> <th style="text-align:right;"> pop </th> <th style="text-align:right;"> gdpPercap </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Albania </td> <td style="text-align:right;"> 76.423 </td> <td style="text-align:right;"> 3600523 </td> <td style="text-align:right;"> 5937.030 </td> </tr> <tr> <td style="text-align:left;"> Austria </td> <td style="text-align:right;"> 79.829 </td> <td style="text-align:right;"> 8199783 </td> <td style="text-align:right;"> 36126.493 </td> </tr> <tr> <td style="text-align:left;"> Belgium </td> <td style="text-align:right;"> 79.441 </td> <td style="text-align:right;"> 10392226 </td> <td style="text-align:right;"> 33692.605 </td> </tr> <tr> <td style="text-align:left;"> Bosnia and Herzegovina </td> <td style="text-align:right;"> 74.852 </td> <td style="text-align:right;"> 4552198 </td> <td style="text-align:right;"> 7446.299 </td> </tr> <tr> <td style="text-align:left;"> Bulgaria </td> <td style="text-align:right;"> 73.005 </td> <td style="text-align:right;"> 7322858 </td> <td style="text-align:right;"> 10680.793 </td> </tr> <tr> <td style="text-align:left;"> Croatia </td> <td style="text-align:right;"> 75.748 </td> <td style="text-align:right;"> 4493312 </td> <td style="text-align:right;"> 14619.223 </td> </tr> <tr> <td style="text-align:left;"> Czech Republic </td> <td style="text-align:right;"> 76.486 </td> <td style="text-align:right;"> 10228744 </td> <td style="text-align:right;"> 22833.309 </td> </tr> <tr> <td style="text-align:left;"> Denmark </td> <td style="text-align:right;"> 78.332 </td> <td style="text-align:right;"> 5468120 </td> <td style="text-align:right;"> 35278.419 </td> </tr> <tr> <td style="text-align:left;"> Finland </td> <td style="text-align:right;"> 79.313 </td> <td style="text-align:right;"> 5238460 </td> <td style="text-align:right;"> 33207.084 </td> </tr> <tr> <td style="text-align:left;"> France </td> <td style="text-align:right;"> 80.657 </td> <td style="text-align:right;"> 61083916 </td> <td style="text-align:right;"> 30470.017 </td> </tr> </tbody> </table> ] --- # Excursus: Tables in `R Markdown` *Note*: If you want to [reference tables (or figures) in `R Markdown` documents](https://bookdown.org/yihui/rmarkdown-cookbook/cross-ref.html), you need to use the [`bookdown`](https://bookdown.org/home/) output format `html_document2` (or `pdf_document2`). --- # Knitting 🧶 To compile the `R Markdown` document (in this case into a `HTML`) document, you simply need to click the `Knit` 🧶 button. Doing this will generate the `HTML` file (by default) in the directory where the `.Rmd` file is stored. It will also open a preview window in *RStudio*. <img src="data:image/png;base64,#./img/rmarkdown_preview.png" width="40%" style="display: block; margin: auto;" /> --- # Knitting 🧶 Instead of using the *Knit* button in the *RStudio* GUI you can also use the `render()` command from the `rmarkdown` package. --- # Knitting 🧶 .small[ Knitting an `R Markdown` file... 1. Starts a new `R` session - No variables defined - No packages loaded 2. Sets the working directory to the location of the `R Markdown` file 3. Executes all `R` code chunks from top to bottom - Variables are available in subsequent chunks *Note*: For computationally intensive tasks, you can set the option `opts_chunk$set(cache = TRUE)`. It will cache chunk calls and their results as long as you do not edit them. ] --- # How `R Markdown` works <img src="data:image/png;base64,#./img/rmarkdown_wizards.png" width="85%" style="display: block; margin: auto;" /> <small><small>[Artwork](https://github.com/allisonhorst/stats-Artworks) by [@allison_horst](https://twitter.com/allison_horst)</small></small> --- # How `R Markdown` works Behind the scenes, `R Markdown` uses [`knitr`](https://yihui.org/knitr/) to execute the code and create a `Markdown` (`.md`) document with the code and output included, and [`pandoc`](https://pandoc.org/) to convert to a range of different output formats. <img src="data:image/png;base64,#./img/rmarkdown_process.png" width="70%" style="display: block; margin: auto;" /> <small><small>Figure by [Andrew Collier](https://github.com/datawookie)</small></small> --- # Visual `R Markdown` editor If [WYSIWYG](https://en.wikipedia.org/wiki/WYSIWYG) is more your thing, you can rejoice as new(er) versions of *RStudio* (v. 1.4 or higher) now offer a [Visual `R Markdown`](https://rstudio.github.io/visual-markdown-editing/#/) editor. If you have an `.Rmd` document open in *RStudio*, you can open the visual editor via the GUI (in the `Source` pane). <img src="data:image/png;base64,#./img/rstudio_open_visual_rmd.png" width="60%" style="display: block; margin: auto;" /> --- # Visual `R Markdown` editor You can use the visual editor in *RStudio* for editing your `R Markdown` document similar to *Microsoft Word*. <img src="data:image/png;base64,#./img/rstudio_visual_rmd.png" width="95%" style="display: block; margin: auto;" /> --- # Some best practices for `R Markdown` - Load all packages in the first code chunk - Never include `install.packages()` -- - Use relative paths or load files from a permanent location - Do not use `setwd()` -- - Use meaningful chunk names - Keep `R` code close to the corresponding prose -- - Set seeds for random number generators (`set.seed()`) --- # Reproducibility information To further increase the reproducibility of your `R Markdown` document you can include some information about your `R` (e.g., the OS, `R` version, and packages that you have used). ```r sessionInfo() ``` --- # Reproducibility information .small[ ``` ## R version 4.1.3 (2022-03-10) ## Platform: x86_64-w64-mingw32/x64 (64-bit) ## Running under: Windows 10 x64 (build 18363) ## ## Matrix products: default ## ## locale: ## [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 ## [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C ## [5] LC_TIME=German_Germany.1252 ## ## attached base packages: ## [1] tools stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] kableExtra_1.3.4 gapminder_0.3.0 dplyr_1.0.6 ## [4] tweetrmd_0.0.8 emo_0.0.0.9000 xaringanthemer_0.3.4 ## [7] xaringanExtra_0.4.0 knitr_1.37 fs_1.5.0 ## [10] rmarkdown_2.11 rprojroot_2.0.2 tarchetypes_0.4.1 ## [13] targets_0.10.0 ## ## loaded via a namespace (and not attached): ## [1] Rcpp_1.0.7 svglite_2.0.0 lubridate_1.7.10 png_0.1-7 ## [5] sysfonts_0.8.8 ps_1.6.0 assertthat_0.2.1 digest_0.6.27 ## [9] utf8_1.2.1 mime_0.10 R6_2.5.0 backports_1.2.1 ## [13] evaluate_0.14 httr_1.4.2 xaringan_0.21 highr_0.9 ## [17] unilur_0.4.0.9000 pillar_1.6.1 rlang_0.4.11 curl_4.3.1 ## [21] uuid_0.1-4 rstudioapi_0.13 data.table_1.14.0 whisker_0.4 ## [25] callr_3.7.0 jquerylib_0.1.4 klippy_0.0.0.9500 webshot_0.5.2 ## [29] stringr_1.4.0 munsell_0.5.0 igraph_1.2.6 hunspell_3.0.1 ## [33] compiler_4.1.3 xfun_0.30 systemfonts_1.0.2 pkgconfig_2.0.3 ## [37] htmltools_0.5.1.1 spelling_2.2 tidyselect_1.1.1 tibble_3.1.2 ## [41] codetools_0.2-18 viridisLite_0.4.0 fansi_0.4.2 crayon_1.4.1 ## [45] showtextdb_3.0 withr_2.4.2 commonmark_1.7 jsonlite_1.7.2 ## [49] lifecycle_1.0.0 DBI_1.1.1 magrittr_2.0.1 scales_1.1.1 ## [53] cli_3.2.0 stringi_1.6.2 xml2_1.3.2 bslib_0.2.5.1 ## [57] ellipsis_0.3.2 generics_0.1.0 vctrs_0.3.8 showtext_0.9-5 ## [61] glue_1.6.2 purrr_0.3.4 processx_3.5.2 yaml_2.2.1 ## [65] colorspace_2.0-1 rvest_1.0.0 base64url_1.4 sass_0.4.0 ``` ] --- class: center, middle # [Exercise](https://crsh.github.io/reproducible-research-practices-workshop/exercises/2_rmarkdown_question.html) time 🏋️♀️💪🏃🚴 ## [Solutions](https://crsh.github.io/reproducible-research-practices-workshop/exercises/2_rmarkdown_solution.html) --- # `R Markdown` resources .small[ The [*RStudio* `R Markdown` Cheatsheet](https://raw.githubusercontent.com/rstudio/cheatsheets/master/rmarkdown-2.0.pdf) The [`R Markdown` materials by *RStudio*](https://rmarkdown.rstudio.com/index.html) The [`R Markdown` chapter](https://r4ds.had.co.nz/r-markdown.html) in *R for Data Science* by Hadley Wickham [*R Markdown: The Definitive Guide*](https://bookdown.org/yihui/rmarkdown/) by Yihui Xie, J. J. Allaire, and Garrett Grolemund [`R Markdown Cookbook`](https://bookdown.org/yihui/rmarkdown-cookbook/) by Yihui Xie, Christophe Dervieux, and Emily Riederer [*R Markdown for Scientists*](https://rmd4sci.njtierney.com/) by Nicholas Tierney [*R Markdown Tips and Tricks*](https://indrajeetpatil.github.io/RmarkdownTips/) by Indrajeet Patil ] --- # Outlook `R Markdown` is a great tool (esp. for reproducibility) and will continue to be used and extended... -- BUT... there is a potential (or likely?) successor in the wings: "[Quarto](https://quarto.org/) is a multi-language, next generation version of R Markdown from RStudio, with many new features and capabilities" --- # Outlook: Quarto - support for `R`, `Python`, [`Julia`](https://julialang.org/), and [`Observable`](https://observablehq.com/) - can also be used with [`Jupyter`](https://jupyter.org/) notebooks - even more output formats For further details check out the [Quarto documentation](https://quarto.org/) and this [blog post by Alison Hill](https://www.apreshill.com/blog/2022-04-we-dont-talk-about-quarto/). *Note:* For `R`, Quarto uses R Markdown under the hood, so everything you learn here is fully compatible with Quarto.