Prerequisites

Below are the details. You must accomplish three steps before attending the workshop.

  1. Install required software
  2. Create your GitHub Account
  3. Cache your GitHub Credentials

Details below.

Install Required Software Before the Workshop

To complete the hands-on portion of the workshop you’ll need software pre-installed on your laptop. Due to the nature of the workshop we will not have time to troubleshoot installations during the workshop. Please be sure to perform the following steps on the laptop you bring to the workshop.

Download and install: Git, R, and RStudio (in that order). I recommend accepting the install defaults for the following applications:

Software Applications


Click on the link to your OS




If you haven’t yet, install each of the above applications. These brief tutorial videos are helpful if you’re unsure of how to install R, RStudio or install R packages.

Create GitHub Account and Verify Access

We will use GitHub to create an initial public host for the repository you create during the workshop. GitHub is free. If you choose not to continue using GitHub, you can easily delete the account.

  1. Sign up for GitHub using the form on their front page: https://github.com. Use your Duke email address
  2. , Then Create the Account

Cache Credentials

The following are one-time configuration steps.

HTTPS: Configure R/RStudio to work with your Git/GitHub

For most new Git users, the following steps are the most convenient and efficient for configuring your new applications for Git version control. If you use two-factor authentication with GitHub, skip the the SSH section below. The video clip can be used to clarify the written instructions below.

In your RStudio Console…. (image)

  1. Install the usethis package: install.packages("usethis")
  2. Load the usethis package: library(usethis)
  3. In the RStudio console, configure usethis You will need to follow the instructions from within the console, after invoking the use_usethis function:

    1. use_usethis()
    2. Restart R

  4. Configure your Git client with your GitHub email address

    1. library(usethis)
    2. use_git_config(user.name = "<<github ID>>", user.email = "<<my github associated email address>>")
    3. For example: use_git_config(user.name = "libjohn", user.email = "libjohn@duke.edu")

  5. Generate a GitHub Personal Access Token (PAT) and associate that token within your RStudio Environment (.Renviron). Do this by running the following command in the RStudio console and following all the prompts. When you run the command, below, this will spawn a GitHub Page that generates a PAT. Copy the PAT into your clipboard buffer. Paste the PAT into RStudio’s editor window for the .Renviron file. the PAT is your personal token; do not share it. You can do all this by invoking the browse_github_pat function in the RStudio Console and following the resulting console prompts. If you need more detail, see the usethis Setup instructions.

    1. browse_github_pat()
    2. The RStudio Console will direct you how to edit_r_environ() in the RStudio Editor window
    3. Restart R

Let’s assume you did everything correctly. If you want to test it, try to clone a repository with the following instructions. Now you’re ready go to the Hands-On section which we will cover in the workshop.

The workshop will begin with the Hands-On Instructions


SSH: Generate SSH keys

Legacy Documentation Links

If you followed the HTTPS section, above, you do not need to also follow the links below. For those who use two-factor authentication at GitHub, I recommend SSH keys. However, I no longer recommend SSH to Git newbies, because it’s more complicated. At the same time, the workshop procedures rely heavily on the usethis package and may not work via SSH without more extensive configuration of the SSH keys. Therefore, while it is possible to combine the usethis package with SSH keys, configuring this suite of applications and functions is beyond the scope of our workshop. Nonetheless, I am leaving these SSH Keys instructions here as legacy information. Feel free to skip and ignore the following links.

 
R We Having Fun Yet‽ -- Learning Series
Data & Visualization Services
Duke University Libraries
C bn
Shareable via Creative Commons: CC By-NC