15:00
Day 02
Carleton College
Stat 220 - Winter 2026
Which components of Stat220 are graded?
What percentage of homework problems do you need to successfully complete to earn an A in this class?
How many tokens do you have available to use throughout the term?
5
What room of the CMC are Amanda’s drop-in hours in?
What scenarios describe an inappropriate use of AI in Stat220?
day02 repo and create an R project# to add descriptive section headers for each code chunkgithub.com and confirm you can see your changesHelp! I don’t have a day02 repo
15:00
Oops! I gave you the wrong set of data.
Karl – this is very interesting , however you used an old version of the data (n=143 rather than n=226). I’m really sorry you did all that work on the incomplete dataset.
Bruce
Short Term Impact
Long Term Impact

Scriptability \(\rightarrow\) R
Code environment \(\rightarrow\) RStudio
Literate programming (code, narrative, output in one place) \(\rightarrow\) Quarto
Version control \(\rightarrow\) Git / GitHub
An authoring framework for data science.
A document format (.qmd).
A software package
A file format for making dynamic documents with R.
A tool for integrating prose, code, and results.
A computational document.
What’s in .qmd:
```
test_function(20)
```
How it looks in rendered file:
What’s in .qmd:
```
#| message: false
test_function(20)
```
How it looks in rendered file:
What’s in .qmd:
```
#| warning: false
test_function(20)
```
How it looks in rendered file:
What’s in .qmd:
```
#| echo: false
test_function(20)
```
How it looks in rendered file:
[1] 20
This is a message.
Warning in test_function(20): This is a warning!
Sometimes, you’ll want to set every chunk option at once. You can do so in the YAML header using execute:
There’s an example HTML report on the schedule
Your task is to reproduce it in 02-example-lego.qmd
To be as reproducible as possible, you’ll need to use:
Where do I find 02-example-lego.qmd?
If you have a day02 repo, use that!
If you don’t have a day02 repo, you can find 02-example-lego.qmd on the schedule

For example, instead of typing 19798 you would include nrow(sets) as an inline code chunk. Make sure the report knits and you get the right values.
Next, add a parameter to your YAML header that stores the location of the data set. Make sure the report knits.
Change the code chunk where you load the data set to use the data parameter you just defined rather than the hard-coded URL. Make sure the report knits.
Now, let’s make a parameter for the source of the data set so you don’t have to search where every mention of it in the report, it will be with the other metadata (where it belongs). To do this, add a parameter that gives the source of your data (call it data_source) and set it equal to “the 2022-09-09 repository on Tidy Tuesday.” Make sure the report knits.
At this point it looks like everything is working—awesome job! To put it to the test, let’s update the parameters of your report and knit it to see if everything changes as we would expect. Here are the new parameter values: