From Data to Manuscript in R

Winter 2025 Home

Professor

  • Dr. Natalie Dowling
  • Email: ndowling@uchicago.edu
  • GitHub: @nrdowling
  • Office: 1155 Building, Room 404

Section 1

  • Weekly meetings: Mondays and Fridays 1:30pm - 2:250pm
  • 1155 E 60th St, Room 289B
  • TA: Mian Li
    • Email: lim1an@uchicago.edu
    • GitHub: @lim1an

Section 2

  • Weekly meetings: Mondays and Fridays 3:00pm - 4:20pm
  • 1155 E 60th St, Room 289B
  • TA: Yuchen Jin
    • Email: yuchenjin@uchicago.edu
    • GitHub: @regenchen

Office hours

Students are welcome to attend any office hours for help with ongoing work or general support, regardless of section. For discussion about grades, you should meet with your section TA or Dr. Dowling. TAs cannot discuss grades with students outside of their section.

  • Dr. Dowling: Thursday 2pm - 4pm; 1155 E 60th St, Room 404
  • Mian Li: Friday 9am - 10:30am; 1155 E 60th St, MAPSS 4th Floor Lounge (no signup required)
  • Yuchen Jin: Monday 4:30pm - 6pm; 1155 E 60th St, MAPSS 4th Floor Lounge (no signup required)

Hubs

View the main syllabus for details.

Course schedule

The accordion boxes contain detailed information about each class meeting. Tasks are color coded:

  • Ungraded assignments, preparatory tasks, readings, and resources are in blue boxes.
  • Class meeting plans, lecture topics, and links to slides/materials are in orange boxes.
  • Reminders and extra information relevant to that class period are in red boxes.
  • General to-dos and optional exercises to complete following each class are in teal boxes.

Unit 1: Fundamentals of GitHub, R, and Quarto

Week 1: Getting Started

Setting Up; Solving Problems

Week 1 | Class 1

Monday, January 6, 2025

  • Readings & Resources:
    • Resources page: Get a head start by browsing some of the listed resources. The D2MR guides are going to be espeically helpful for the first week or two of class.
    • Syllabus (you are here): We’ll go over the syllabus in our first class, but the structure of this class is pretty unusual. You’ll want to look over the syllabus policies (especially grading and assessment) in advance.
  • Tasks:
    • Create a GitHub education account
    • Complete the pre-quarter survey
    • Join the Slack workspace (invites sent to your .edu address)
  • Materials:
  • Class plans:
    • Introductions
    • Syllabus Review
    • Lecture: Say Hello to RStudio, GitHub, and Quarto
    • Workshop: Get started on “getting started”

Don’t procrastinate on selecting your dataset! Ideally you will have entered the class with a dataset ready to go. If you didn’t, that needs to be your top priority. The whole course is centered around progressing on your final research project, and you can’t do anything without a dataset.

When you have a dataset in mind, review the dataset selection guidelines to be sure it meets the requirements. If you have questions, send an email to Dr. Dowling and cc your section TA.

There’s a lot of setup tasks you need to complete before our second class meeting. We started in class, but you’ll need to finish on your own.

What exactly do you need to do? Look ahead to the “Before class” tab for next class. This is what you should always do to see what you’re responsible for doing before that class meeting.

Week 1 | Class 2

Friday, January 10, 2025

  • Readings & Resources:
  • Tasks:
    • Download and install R and RStudio
    • Join GitHub & the class Slack workspace
      • Slack invites are sent to your UChicago email, email Dr. Dowling if you don’t have one
      • say hi in the intro channel (at a minimum, we need you to say your full name, GitHub username, and section number; please give more of an intro if you’re up for it!)
    • Connect GitHub and RStudio (guide)
      • You can use your final project repo for this, but consider using a “tester” to get the hang of it first.
    • Create a GitHub repo and RStudio project for your final project that uses Quarto and the apaquarto extension (guide)
      • There are (at least) 3 ways to do this! Refer to the guide to decide which method you want to use:
        1. Start totally 100% from scratch
        2. Add just the required apaquarto extension files to an existing project
        3. Add all apaquarto files to an existing project
      • confirm you can pull from and push to your remote repo on github
      • add Dr. Dowling (@nrdowling) & section TA (S1 Mian: @lim1an; S2: Yuchen: @regenchen) as collaborators
    • Fork the assessments repo (guide in the repo’s README)
      • clone to an RStudio project
      • confirm you can pull from the upstream repo and push to your fork
      • add Dr. Dowling (@nrdowling) & section TA (S1 Mian: @lim1an; S2: Yuchen: @regenchen) as collaborators
  • Materials:
  • Class plans:
    • Lecture: Best Practices & Troubleshooting
    • Activities: (time permitting)
      • Troubleshooting setup tasks
      • Setup and experiment with copilot in RStudio

To-do:

  • Finish any setup tasks you didn’t complete before class
  • Look ahead to next Monday’s class materials. Lectures next week are long and dense, so reviewing resources ahead of time is going to be very important.

Recommended exercises:

  • Create a README.md and .gitignore for your final project repo. Practice using the problem-solving strategies from today’s class to figure out 1) what these things are, 2) why they’re important, and 3) how to create them. Keep best practices in mind as you do this, especially regarding comments and transparency.
  • Set up Copilot in RStudio and experiment a little. What do you think? How could it be useful to you? Any immediate benefits or drawback jump out at you? Is it something you want to make use of in your work?

Week 2: Fundamentals

GitHub & R Essentials; Quarto & Markdown Essentials

Week 2 | Class 1

Monday, January 13, 2025

Readings & Resources:

*Required reading

  • Materials:
  • Class plans:
    • Lecture: GitHub & R Essentials
      • Note: This is a long, dense lecture that we probably won’t make it all the way through, so be sure to review the slides and read the required readings before class!
    • Activities:
      • Probably none
      • If by some chance we get through the whole lecture with time to spare we’ll work on some simple programming exercises

Annoucements:

  1. Office hours: For the time being I need to limit my office hours to a maximum of 2 appointments per quarter. I am hopeful that at some point in February I will be able to add more hours each week so that I don’t have to have a per-quarter cap. I’ll keep you posted if that’s the case!
  2. Copilot: Using copilot in RStudio (or any AI/LLM) is fully optional for this course.
    • I do recommend setting it up and trying it out, but you are not required to do so, and it’s not worth driving yourself up a wall for. You do not need Copilot for any material on the syllabus, and it does not have to be part of your troubleshooting/debugging workflow. The integrated Copilot in RStudio isn’t designed for debugging anyway, since it’s essentially a fancy autocomplete and not something you can prompt with questions.
    • The one thing I’ll add here is a link to RStudio’s documentation for using Copilot. If you’re just getting started that’s the place to go first. (Also, if you started there but have since hit issues and tried a bunch of other things, it never hurts to just download a fresh copy of RStudio and start from scratch! The “have you tried turning it off and on again” approach solves more problems that you might expect.)
    • Please continue to ask for help setting it up on Slack, but know that we will not cover this in class.
  3. Assessment repo: Be sure to pull from the assessments repo frequently. This is where I will add/update both mini-project guidelines and materials for in-class demos.
  4. Exercises: The slides for most lectures include at least 1 suggested exercise related to the lecture’s topic. These vary in scope and complexity. They are not required and there is nothing to submit.
    1. All exercises include a box on the slide listing the numbers of the assessed and unassessed learning objectives I intend for the exercise to primarily address. This is just for your reference, so you can decide what to prioritize and you can get a sense of what kind of things demonstrate each objective. You can see which numbers go with which objectives either by rendering the assessment.md file or by referring to the website.
    2. Some exercises additionally reference an associated mini-project, which are usually additional guidelines to complete a moderately more complex version of the exercise. For exercises that do not have an associated mini-project, you are welcome to expland the exercise into a full mini-project. Follow the “off-the-menu” instructions to do so.

To-do:

  • Programmer’s groceries demo
    • The groceries.qmd notebook walks through examples of writing conditionals and defining functions based on a very old and cliche joke. The notebook includes both extensive markdown explanation and code in chunks you can run individually.
    • Start by working through the notebook and executing the code, then experiment a little with the code to see if you can make things more efficient or introduce new scenarios.
  • Next class on R Markdown & Quarto will be another dense lecture, so be sure to review the slides and read the required readings and preview the slides before class. Slides will be posted by Wednesday.

Recommended exercises: View slides for additional details for each exercise.

  • GitHub required files: Revisit the README.md and .gitignore files you created in the W1C2 exercises. With your new knowledge of the whats and whys of GitHub and these files, revise the README to make it more informative and revise the .gitignore to include any files or folders that fall into the categories we discussed in class.
  • Simple .R script: Write a simple .R script that (minimally) loads the tidyverse packages, requires a package, includes commented text, and assigns at least one numberic and one string variable. To go further, use vectors to create a data frame or tibble and/or source() your R script into a code chunk in an R Markdown document.
  • hello_world() function: Define a hello_world() function in an .R script that includes object assignment, conditional logic, and (ideally) a for or while loop. The function should take at least one argument and return at least two possible values.
    • Associated mini-project: d2mr-assessment/06_r-programming/01_hello-world
  • Skeleton repo: Create a GitHub repo connected to an R project for either a planned or fictional research project. In the R Project, create a “skeleton” that includes all the files and folders you anticipate needing for the project. Structure your repo to exclude all files and directories that should (for whatever reason) be excluded. As you work, use git best practices for version control, including frequent informative commit messages and functional, up-to-date README and .gitignore files.
    • Associated mini-project: d2mr-assessment/07_git-github/01_skeleton-repo

Week 2 | Class 2

Friday, January 17, 2025

  • Materials:
  • Class plans:
    • Lecture: Markdown & Quarto Fundamentals
    • Activities
      • Probably none, but if by some chance we get through the whole lecture with time to spare…
      • Review the groceries notebook from last class
      • Walk through creating the example hello_world() function

Reminders:

  • No class on Monday, January 20th (MLK Day)
  • When you submit mini-projects, make sure you read the assessment document instructions carefully. Specifically, know when to mark “objective attempt” and “unique objective attempt” in your submission. (You’ll never mark “objective met”, which is for graders.)

Additional information:

  • The no-deadlines-do-what-you-want assessment style of this class is supposed to make it easier, not harder, to learn. If you’re feeling overwhelmed, please let us know so we can help you get back on track! I suggest coming up with a loose timeline for when you’d like to submit mini-projects and research project drafts throughout the quarter, anticipating changes as we go.
  • Recommendations to get you started:
    • Submit your first mini-project by the end of Week 3, and plan on 1 every 2 weeks after that
    • Submit a first (very incomplete!) draft of your research project by the end of Week 4, then additional drafts every 2-3 weeks as needed
      • Your “draft” can be very, very simple. By the end of Week 4, you should be able to confidently demonstrate some skills across multiple categories – GitHub, R programming, markdown, and tidyverse, at least! You do not (and probably should not) wait to submit your first draft until it has all the components you want in the final project. Treat this as iterative and cumulative work.

To-do:

  • Double check that (1) you invited Dr. Dowling and your section’s TA to your repo(s) and (2) they accepted the invitation. If we didn’t accept, the invite link may have expired and you’ll need to re-invite us.

Recommended exercises: View slides for additional details for each exercise.

  • Create apaquarto repos: Create directories for 3 (temporary) apaquarto projects using each of the 3 setup methods. Connect each to a (temporary) github repository. Play around to find where there is flexibility and where things can break.
  • Simple .qmd notebook: Create a new quarto notebook (.qmd), and follow all best practices for notebooks and code chunks as you work. Add a YAML header, at least 1 setup code chunk, at least 1 non-setup code chunk, and narrative text formatted with markdown.
    • Associated mini-project: d2mr-assessment/05_data-communication/02_simple-qmd

Unit 2: Managing data in the tidyverse

Week 3: Welcome to the Tidyverse

Tidy Data & Core Tidyverse Packages

Week 3 | Class 1

Monday, January 20, 2025

All UChicago classes are cancelled for Martin Luther King Jr. Day.

Reminders:

Additional information:

Week 3 | Class 2

Friday, January 24, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Week 4: Manipulating Data

Tidying & Wrangling Data; Data Preparation Workshop

Week 4 | Class 1

Monday, January 27, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Week 4 | Class 2

Friday, January 31, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Unit 3: Analyzing and visualizing data

Week 5: Data Visualization with ggplot2

A Grammar of Graphics; Visualization Workshop

Week 5 | Class 1

Monday, February 3, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Week 5 | Class 2

Friday, February 7, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Week 6: Presenting data for publication

Pretty plots; Tables

Week 6 | Class 1

Monday, February 10, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Week 6 | Class 2

Friday, February 14, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Week 7: Basics of data analysis (for psychologists+)

Descriptive Statistics; Hypothesis Testing

Week 7 | Class 1

Monday, February 17, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Week 7 | Class 2

Friday, February 21, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Unit 4: Disseminating research dynamically

Week 8: Creating your manuscript

Dynamic text; BibTeX & citr

Week 8 | Class 1

Monday, February 24, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Week 8 | Class 2

Friday, February 28, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Week 9: Publishing & polishing

Making the most of Quarto; Your Data to Manuscript Workflow

Week 9 | Class 1

Monday, March 3, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises:

Week 9 | Class 2

Friday, March 7, 2025

  • Readings & Resources:
  • Tasks:
    • Task 1
    • Task 2
    • Task 3
  • Materials:
  • Class plans:
    • Lecture:
    • Activities:

Reminders:

Additional information:

To-do:

Recommended exercises: