Lab 01

Simple Linear Regression

Sep 08 - 09, 2022

Computing toolkit for reproducibility

  • Scriptability \(\rightarrow\) R

  • Literate programming (code, narrative, output in one place) \(\rightarrow\) Quarto

  • Version control \(\rightarrow\) Git / GitHub

You discussed R and RStudio in class this week, so we will focus on version control using Git and GitHub.

Version control and collaboration

Git and GitHub

  • Git is a version control system – like “Track Changes” features from Microsoft Word.
  • GitHub is the home for your Git-based projects on the internet (like DropBox but much better).
  • We will use GitHub as the home for course assignments and activities and for collaboration

What is versioning?


What is versioning?

with human readable messages

Git and GitHub tips

  • There are a lot of Git commands and very few people know them all. 99% of the time you will use git to commit, push, and pull.
  • We will be doing git things and interfacing with GitHub through RStudio
    • If you Google for help, skip any methods for using git through the command line.
  • There is a great resource for working with git and R: happygitwithr.com.
    • Some of the content in there is beyond the scope of this course, but it’s a good place to look for help.

Getting started on Lab 01

Do you have the lab-01 repo?

  • Go to the GitHub course organization: https://github.com/sta210-fa22

  • You should see a repo with the prefix lab-01- followed by your GitHub username

  • If you do not have this repo, please let your TA know!

Demo

Follow along as your TA demonstrates the following:

  • Configure Git using SSH

  • Clone repo (using SSH) and start new project in RStudio

  • Render document and produce PDF

  • Update name in YAML

    • Render, commit, push changes to GitHub

    • See updates in your GitHub repo

Tips for working on lab

  • You do not have to finish the lab in class, they will always be due the following Monday (Thursday labs) or Tuesday (Friday labs). One work strategy is to get through portions that you think will be most challenging (which initially might be the coding component) during lab when a TA can help you on the spot and leave the narrative writing until later.

  • Do not pressure each other to finish early (particularly once you start working on teams); use the time wisely to really learn the material and produce a quality report.

When you're done with lab

  • Make sure all your final changes have been pushed to your GitHub repo

  • Submit the PDF of your responses to Gradescope

    • You can access Gradescope through Sakai or the course website

    • Login using your Duke NetID credentials

    • See Lab 01 instructions for details on submitting an assignment on Gradescope