Assignment 8: Reproducible Report
Due by 11:59 PM on Sunday, May 31, 2026
Assigned: Wednesday, May 27 (Session 16) Due: Sunday, May 31 at 11:59 PM Submit: Quarto document (.qmd) AND rendered HTML on Canvas
See the guides: Setting Up an R Project | Using Quarto Documents
Overview
This assignment brings together everything you’ve learned. You’ll create a complete, reproducible Quarto report that imports data, conducts analysis, and presents findings with narrative text.
The Task
Create a Quarto document that analyzes a dataset and tells a clear story. Your report should be something you’d be proud to share with a colleague or include in a portfolio.
Dataset Options
Choose ONE of the following:
palmerpenguins::penguins— Penguin measurements from Antarcticapsych::bfi— Big Five personality inventorynycflights13::flights— NYC flight data (subset to a specific month/carrier)- Your final project dataset — Get a head start on your project!
Required Elements
Your Quarto document must include:
1. YAML Header (5 points)
---
title: "Your Descriptive Title"
author: "Your Name"
date: today
format:
html:
toc: true
code-fold: true
---2. Introduction (10 points)
- Brief description of the dataset
- Your research question(s)
- Why this is interesting
3. Data Import & Cleaning (10 points)
- Load necessary packages
- Import/load the data
- Any cleaning or transformation needed
- Use code chunks with appropriate options
4. Exploratory Analysis (25 points)
- At least 2 visualizations exploring your data
- Appropriate use of ggplot2 features (labels, themes, etc.)
- Brief interpretation of each visualization
5. Main Analysis (20 points)
- Address your research question(s)
- At least 1 publication-quality figure
- Summary statistics presented clearly (consider using
knitr::kable()for tables)
6. Inline Code (10 points)
Use inline R code to report at least 3 statistics in your narrative text.
Example:
The dataset contains `r nrow(data)` observations...7. Conclusion (10 points)
- Summary of key findings
- Limitations or caveats
- What you would explore next
Formatting Requirements
- Use appropriate headers to organize your document
- Include alt-text for figures (accessibility)
- Code should be visible but foldable (
code-fold: true) - Document should render without errors
Reproducibility Check
Before submitting:
- Restart R (Session → Restart R)
- Render your document from scratch
- Verify all code runs and output appears correctly
Grading Rubric
| Component | Points |
|---|---|
| YAML header | 5 |
| Introduction | 10 |
| Data import & cleaning | 10 |
| Exploratory analysis | 25 |
| Main analysis | 20 |
| Inline code | 10 |
| Conclusion | 10 |
| Code runs without errors | 10 |
| Total | 100 |
Bonus (up to 5 points): Exceptional visualization design, creative analysis, or going beyond requirements.
Submission
Submit both files on Canvas:
Both files are required! The .qmd shows your code, the .html shows it runs correctly.
Tips for Success
- Start with an outline before coding
- Write narrative as you go, not at the end
- Test each code chunk as you write it
- Keep visualizations simple and clear
- Have a friend review your report — does it make sense to someone who hasn’t seen your code?
This assignment is excellent preparation for your final project!
Students enrolled in PSY 510 must complete the following extension in addition to all requirements above.
Graduate Extension: Parameterized Report
A parameterized Quarto report can regenerate automatically for different inputs — different subgroups, conditions, time points, or datasets — by changing a single value. This is directly useful for anyone running multiple studies with the same measures, or generating participant-level summaries from a single template.
Task G.1
Add a params block to your YAML header defining at least one parameter. The parameter should meaningfully affect your analysis. For example:
params:
subset: "all" # options: "all", "Female", "Male"Or, if using your final project dataset:
params:
data_file: "data.csv"Task G.2
Use your parameter somewhere in the analysis — to filter the data, set a plot title, or choose a file to import. Show that the document renders correctly for at least two different parameter values by rendering it twice (from the command line or RStudio’s Knit menu → “Knit with Parameters”).
# Example usage inside a code chunk:
if (params$subset != "all") {
data <- data |> filter(gender == params$subset)
}Task G.3
In a brief prose block in your Quarto document (not just a comment), describe one realistic scenario from your own research area where a parameterized report would save meaningful time or reduce error.
Submission: Submit your .qmd and two rendered .html files (one per parameter value). Name them to reflect the parameter used (e.g., report-all.html, report-female.html).