Introduction to Quarto

STAT 218 - Week 2, Lecture 2, Lab 2

January 17th, 2024

From the Last Week’s Lab

In our first steps in R, we

  • said “Hello World” by using print()function
  • created an object by using object assignment operator (<-)
  • created a data frame
  • installed openintro and tidyverse packages.
    • If you did not install those, please install them by using install.packages() function.

What about This Week?

This week we will do the followings:

  • Creating A STAT-218 Folder in Your Desktop
  • Creating A New Quarto Document
    • Saving this document to your STAT-218 Folder
  • Filling out the Document
    • My First Heading
    • My Second Heading (Subheading)
    • My Text
    • My Code
  • Rendering The First PDF
  • Your First Homework

Task 1: Create A Folder

Task 2: Refresh Your Memory

What is Quarto?

Quarto is…

  • an open-source scientific and technical publishing system
  • a multi-language, next-generation version of R Markdown.
  • enabling you to combine code and text to create rich outputs, like reports and presentations. (like an advanced version of a word processing tool)

Important

  • R is the programming language for statistical computing
  • RStudio is the IDE that facilitates R programming
  • Quarto document is a document type that combines text and code
  • In short, we will create Quarto documents in RStudio and we will use text and R codes in that Quarto document.

Creating a Quarto Document


  • We will use Quarto to produce (render!) PDF documents for our lab assignments, take-home midterm, and final project where we integrate both text and code.

Tip

  • You can create your own Quarto document by clicking File > New File > Quarto Document

  • Let’s try to create our first Quarto document!

Creating a Quarto Document

Pane Layout in RStudio

How to Create a New Quarto Document

Panes in RStudio

A Closer Look into the Quarto Document

Task 3: Play with Your First Quarto Document

Delete The Default Content

Add Headings and Text

Add A Code Chunk

Add This Simple Code

Run the Code Chunk

Check Your Document Before Rendering

Rendering a PDF Document

  • The Quarto document that we created is a source file.

  • By rendering this, will have a different output file (e.g., PDF)

Rendering a PDF Document

Open your terminal pane and type the following:

quarto install tinytex


Rendering a PDF Document

## Rendering a PDF Document

Lab Assignment 1

  • Please upload this PDF document to our Canvas page as Week 2 LAB Assignment 1 (Individual)

  • Begining from the next week, we will start working in groups.