1.8 Formatting with Quarto

In this assignment, you will recreate a Quarto document that I’ve already compiled (workbook appendix). You can only see the compiled HTML version, and your task is to reverse-engineer the quarto file by adding the necessary formatting, text, math, and code chunks in your own document. This exercise will help you become familiar with using Quarto, which you’ll need throughout the course.

Getting Started:

  1. Go here: https://cran.r-project.org/ and follow the instructions to download R for your Linux, Windows, or Mac. You should download the latest release.

  2. Then go here: https://posit.co/download/rstudio-desktop/ and click the blue button that says step 2: install RStudio Desktop.

    Mac users: make sure you know whether you have an Apple silicon mac or an older intel-based mac and make sure that you download the correct version of R. If you’re using a mac, you’ll also need to install xquartz: https://www.xquartz.org/.

  3. Open Rstudio and go to File > New File > Quarto Document.

  4. Add a title to the file and enter you and your groupmates’ names under Author.

  5. Keep the format at HTML and hit Create.

    Avoid the visual editor at all costs: make sure to toggle over to source and leave it there.

    You’ll also want to periodically save your document (Command S on Mac, Ctrl S on Windows) and compile it to HTML (hit Render) to see your progress.

  6. Install the tidyverse: in your RStudio console, run the line of code install.packages("tidyverse")

Quarto Formatting Hints:

Text is formatted using markdown:

    | This | is   | a     | table |
    |------|------|-------|-------|
    | with | some | words | in    |
    | it.  |      |       |       |

Math is formatted using LaTeX:

\begin{align}
y &= mx + b \\
z &= x^2 + y^2
\end{align}

Here’s how to add R code, especially to draw a plot:

    ```{r}
ggplot() +
  stat_function(fun = function(x) 3 * x + 2, color = "red")
(3 / 2) * 2 ^ 2
[1] 6