Introduction to the Toolkit

Dr. Mine Dogucu

A headshot of a woman with curly, short, ear-length hair with green eyes and red lipstick.

minedogucu.com
mdogucu
MineDogucu
mastodon.social/@MineDogucu
minedogucu

RStudio Setup

tidyverse_style_guide

canyoureadthissentence?

tidyverse_style_guide

age <- c(6, 9, 15)

data.frame(age_kid = age)

After function names do not leave any spaces.

Before and after operators (e.g. <-, =) leave spaces.

Put a space after a comma, not before.

Object names are all lower case, with words separated by an underscore.

Say Goodbye to R Markdown and Say Hello to Quarto

Demo

Slides for this bootcamp

Slides that you are currently looking at are also written in R Markdown. You can take a look at them on GitHub repo for the bootcamp website.

Introduction to Git and GitHub

version control

Does this look familiar?

  • hw1

  • hw1_final

  • hw1_final2

  • hw1_final3

  • hw1_finalwithfinalimages

  • hw1_finalestfinal

What if we tracked our file with a better names for each version and have only 1 file hw1?

  • hw1 added questions 1 through 5

  • hw1 changed question 1 image

  • hw1 fixed typos

We will call the descriptions in bold commit messages.

git vs. GitHub

  • git allows us to keep track of different versions of a file(s).

  • GitHub is a website where we can store (and share) different versions of the files.

Demo

We have actually done something similar to this demo before by cloning the test repo and committing, and pushing.

Always use .Rproj file to open projects. Then open the appropriate .qmd / .R file from the Files pane.

Cloning a repo

repo is a short form of repository. Repositories contain all of your project’s files as well as each file’s revision history.

For this bootcamp our daily repos (lecture code, activity etc.) are hosted on Github.

To clone a GitHub repo to our computer, we first copy the cloning link as shown in screencast then start an RStudio project using that link.

Cloning a repo pulls (downloads) all the elements of a repo available at that specific time.

Commits

Once you make changes to your repo (e.g. take notes during lecture, answer an activity question). you can take a snapshot of your changes with a commit.

This way if you ever have to go back in version history you have your older commits to get back to.

This is especially useful, for instance, if you want to go back to an earlier solution you have committed.

Push

All the commits you make will initially be local (i.e. on your own computer).

In order for me to see your commits and your final submission on any file, you have to push your commits. In other words upload your files at the stage in that specific time.

(An incomplete) Git/GitHub glossary

Git: is software for tracking changes in any set of files

GitHub: is an internet host for Git projects.

repo: is a short form of repository. Repositories contain all of your project’s files as well as each file’s revision history.

clone: Cloning a repo pulls (downloads) all the elements of a repo available at that specific time.

commit: A snapshot of your repo at a specific point in time. We distinguish each commit with a commit message.

push: Uploads the latest “committed” state of your repo to GitHub.

Do you git it?

EDA review

  • What R functions do you remember?
  • Can you load the titanic_train data from the titanic package?
  • What ggplot functions do you remember?