Homework 1

Instructions

Write up a .qmd file showing some exploratory analyses of the Swiss fertility data1. Upload both the .qmd file and the .html file to Canvas. You must upload BOTH for credit.

1 swiss ia a built-in dataset in R. You can print the whole dataset by running swiss in your console. Use names(swiss) to see all available variable names. Running View(swiss) will pop up an interactive data viewer window.

2 You can explore all built-in plots available in base R by running library(help = "graphics") in the console or check out sections 4.2 & 4.3 of An Introduction to R.

3 You can keep this simple (like the example from lecture) or make it as complex as you’d like!

Mix in-line R calculations, R output, and plots with text describing the relationships you see. Include at least one plot2 and one table using the gt package3. You are encouraged to include more! You must use in-line R calculations/references at least once (e.g. functions like nrow(), mean(), sd(), cor(), median(), min()) and may not hard-code any numbers referenced in your text.

Your document should be pleasant for a peer to look at, with some organization using sections or lists, and all plots labeled clearly. Use chunk options echo and output to limit the code/output you show in the .html. Discussion of specific values should be summarized in sentences in your text—not as printed code and output—and rounded so as not to be absurdly precise (e.g. round x with round(x, 2)).

Before you submit:

Have you remembered to add embed-resources: true to your YAML?

Template

rendered html fileraw qmd file

Example

rendered html fileraw qmd file

Due Dates

# Homework Due Peer Review Due
1 7 October 12 October
2 14 October 19 October
3 21 October 26 October
4 28 October 2 November
5 11 November 16 November
6 18 November 21 November
7 25 November 30 November
8 2 December 7 December
9 9 December 14 December