Class 6 — Welcome to RStudio & the Tidyverse

Part II
Quiz 1 opens the class, then Python and PsychoPy give way to R. You’ll read your own pilot data into RStudio as a tibble and compare its shape to a published Stroop dataset.
Published

October 13, 2026

This is the Part I → Part II hinge: you used Python and PsychoPy to build the experiment and collect the data, and starting today you’ll use R and RStudio to analyze it. Quiz 1 (covering classes 1–5) opens the class before any new material. You’ll then tour RStudio’s panes and Projects, read your own Class 5 pilot CSV in with readr, and compare its shape to a worked published Stroop dataset, diagnosing what’s messy about your file without fixing it yet.

Reading due: Data Skills ch. 1–2 · Due today: Quiz 1 (no homework due today — deliberately)

What you’ll be able to do

  1. Navigate RStudio’s four panes (Console, Environment/History, Files/Plots/Packages/Help/Viewer, Source) and explain what an RStudio Project is for.
  2. Read a .csv file into R as a tibble using readr::read_csv(), and inspect it with glimpse() and head().
  3. Define “tidy data” (one row per observation, one column per variable) and identify messy vs. tidy features in your own Class 5 pilot file.
  4. Compare your own Stroop-style pilot data’s structure to a worked published Stroop dataset, recognizing the same underlying shape (condition, RT, accuracy) in both.
  5. Describe RStudio’s Git pane cycle — stage, commit, push — after watching it demonstrated live, and run it yourself at home before Class 7 using the steps below. (This is how every homework from Class 7 onward gets submitted, and it’s fair game for Quiz 2.)
  6. Recall, via Quiz 1, core Think Python vocabulary and PsychoPy Builder mechanics (routines, conditions files, loops, custom code components, the minimum-observations rule) from Part I.

Before Class 7: connect RStudio to your repo (~15 minutes, at home)

In class you watched the Git pane do its stage → commit → push cycle. Before Class 7, do it once yourself, so that HW3 (assigned in Class 7) has a working submission path. Getting stuck is normal and fixable; post on Piazza or see me during drop-in hours or a scheduled appointment, and I’ll see your test push (or its absence) beforehand, so nobody falls through the cracks.

  1. Install Git (the program RStudio’s Git pane drives). Windows: download and run the installer from gitforwindows.org — every default option is fine. Mac: open RStudio’s Terminal tab (Tools → Terminal → New Terminal), type git --version, and press Return; if a version number prints, you already have it, and if a popup offers to install “command line developer tools,” accept (it can take a few minutes).
  2. Restart RStudio so it notices Git.
  3. Tell Git who you are. In RStudio’s console, run install.packages("usethis", dependencies = TRUE), then usethis::use_git_config(user.name = "Your Name", user.email = "the-email-on-your-github-account"). Optional privacy tip: git stamps this email into every commit you make. If you’d rather keep it out of any copy of your work you might someday share, turn on Settings → Emails → “Keep my email addresses private” on GitHub first, and use the …@users.noreply.github.com address it shows you as the email here instead.
  4. Create a GitHub token (GitHub’s replacement for typing your password): run usethis::create_github_token() — a browser page opens on GitHub; click Generate token at the bottom and copy the long string that appears (you only see it once).
  5. Store the token: run gitcreds::gitcreds_set() and paste the token when asked. (If anything later pops up asking for your GitHub password, paste the token there instead — GitHub no longer accepts account passwords for this.)
  6. Clone your repo: in RStudio, File → New Project → Version Control → Git. The Repository URL comes from your course repo’s green Code button on GitHub.com (the HTTPS address). Pick a folder location you’ll remember.
  7. The test push: open your repo’s README.md in RStudio, add one line at the bottom — First push from RStudio — and save. In the Git pane: check the box next to README.md (stage), click Commit, type the message my first push from RStudio, commit, then click Push.
  8. Verify it worked: open your repo on GitHub.com — you should see your new commit message at the top of the file list. That’s the whole loop, and it’s exactly how you’ll submit HW3.

If the Git pane never appears after step 6: Tools → Global Options → Git/SVN — if the “Git executable” box is empty, restart your computer and reopen RStudio; if it’s still empty, post a screenshot of that settings pane on Piazza.

Back to top