HW 01: Meet the Toolkit

Programming with R, RStudio, and Quarto

Purpose

Now that you’re connected to JupyterHub, it’s time to actually use the toolkit. This assignment has two parts. In the first it has you watch a short video walkthrough of the basics of programming with R, and follow along live in your own copy of a real analysis — the Bechdel test exercise. In the second part it walks you through setting up a Github account, and connecting it to RStudio.

WarningRead ahead

It’s always a good idea to read over the entire assignment first so you know what is expected out of you. Sometimes earlier learning directly connects to later questions.

Part 1: Programming Toolkit

1. Intro to R and Quarto

Watch first part of the Meet the Toolkit: Programming video (34 min total)

  • This video serves to to introduce you to Programming toolkit, and give you some hands on learning with R via the bechdel analysis.

  • Pause around minute 15 when she transitions to Posit Cloud and move on to #2.

As of 8/6/26, there are 24600 R packages available on CRAN
  1. Get the assignment file
    • Log into Jupyterhub and Launch Server.
    • Navigate to the shared/Donatello DATA 385 folder on the landing page
    • Right click and “copy” the bechdel.qmd file.
    • Navigate back up to your home directory, right click and “paste” this file.
  2. Start RStudio, then open this bechdel.qmd file from the lower right ‘files’ pane.
  3. Return to the video and follow along in your own copy of bechdel.qmd as you watch, filling in each blank (___) as it’s covered.
    • Not every blank will be filled in through the video, but the information needed to fill in the blanks is in the code and/or output. It’s your job to identify where that information comes from!
  4. Once all blanks are filled in, change the format type in the YAML header to PDF, re-render and make sure the result looks good.
  5. Export or Download your final PDF to your computer and submit via Canvas.

Part 2: Setup Version Control

1. Introduction

Watch this video overview of what Git and Github are, and how we’re going to use this part of the toolkit. This is a Duke video, so remember that some information about homework and access may not be relevant.

2. Update your GitHub profile

In HW00 you created your github account. Now let’s do some updates to it so that you can connect to our class organization.

You can do this step while following along with the video (know that the menu options and placement may have changed) or by following the steps below and referencing https://happygitwithr.com/

  1. Click your profile icon in the upper right and select Settings.
    • Click Emails in the left sidebar and turn off Keep my emails private. This is necessary for us to be able to add you to the course organization.
    • You can set a secondary/backup email if you wish, it can come in handy.
  2. Click Public Profile in the sidebar and add your name at the top.
    • You can add as much or as little additional information as you would like here.
    • Click Update profile when you’re done.
    • Adding a profile picture is not required, but it helps us recognize you and helps you recognize your classmates.

3. Connect your GitHub account to RStudio.

We will be using git through RStudio using the GUI and the terminal. This is not the only way to work with git, but I have found this is easier for beginners and this is a smooth workflow. This section will reference various sections within Happy Git with R.

Important

If you logged out of RStudio/Jupyterhub before this step - Relog back in now and Restart RStudio.

  1. Introduce yourself to Git (Ch 7 top)
    • open terminal & type the following commands, substituting your name and the email associated with your GitHub account. git config --global user.name "Jane Doe" git config --global user.email "jane@example.com" Confirm with git config --global --list
  2. Login to Github
  3. Create a PAT (HappyGit: Read Ch9 intro, Do 9.3, 9.4, 9.4.1.1 in the R console)
    • In the R console type: usethis::create_github_token(). This will open a browser tab to Github.
    • Name this token something clear like “cal icor for ds class”
    • leave default boxes checked
    • click copy button to copy your pat
  4. Save your username & PAT somewhere safe and accessible
    • Unfortunately JupyterHub will not save your PAT between sessions.
    • Keep your username and PAT somewhere save like a password manager, as every time we push/pull from GitHub it will ask for your credentials.
    • NEVER UPLOAD YOUR PAT TO GITHUB

You’re all set! Next week we will be cloning our first repo into Rstudio using these credentials. If you are struggling or encounter a problem do not wait to reach out.