Assignments should be submitted through Quarto worksheets (.qmd files).
After some classes, a worksheet will be available for download on the course page. This worksheet contains exercises with blanks for you to fill in with your code and answers. Upon completing an assignment, upload your .qmd file via the course page.
What is Quarto?
Quarto is a modern authoring system for data analysis reports. A Quarto document (.qmd) integrates text, code, and the results of code execution (tables, printouts, figures, etc.) into a single, reproducible report.
Start here:
https://quarto.org/docs/get-started/
Essentials of Quarto for assignment submission
- Quarto documents utilize Markdown syntax. Here are some Markdown basics:
# This is a top-level header (counterpart of <h1> in HTML)
## This is a second level header
*This text will be in italic*, **this text will be in bold**, ***and this will be in both italic and bold***.
1. Ordered lists are automatically numbered.
3. The numbering in the source file is irrelevant
* You can create hierarchical lists
* no biggie
- Embedding R code in Quarto documents is straightforward:
```{r}
hist(rnorm(200)) # histogram of 200 random numbers from a normal distribution
# The backticks that start and end a code block are typed using the tilde key (`~`), not the single quote key (')
# Remember, backticks are not apostrophes!
```
- Quarto also supports chunk options using
#|lines (recommended):
```{r}
#| echo: true
#| warning: false
hist(rnorm(200))
```
Rendering a Quarto document involves executing R code in code blocks and compiling the document into HTML/PDF format together with the output.
- In RStudio: open the
.qmdfile and click Render. - In the terminal: run
quarto render your_file.qmd. - All assignments MUST render successfully.
- In RStudio: open the
Your working directory during an interactive R session can be identified using the
getwd()function. When rendering a Quarto document, the working directory is set to the location of the.qmdfile. This detail is crucial.Use relative file paths. Avoid absolute paths like
C:\\Users\\...\\Desktop\\...— they will not work on my machine when I render your submission.Avoid using
install.packages()inside your.qmdfile. Assume required packages are installed and load them withlibrary(...).Ensure your
.qmdfiles are saved with the correct encoding (UTF-8; see the Troubleshooting page).If you use Generative AI for coding assistance, follow the disclosure rule described on the ChatGPT / AI policy page.