Example 01: Get up and running

We will be working with the most recent stable versions of R and RStudio, as well as with a number of additional packages. You will need to install R, RStudio, and the necessary packages on your own computer.

1. Install R on your computer

Begin by installing R (http://cloud.r-project.org). Choose the version appropriate for your computing platform:

2. Install RStudio on your computer

3. Installing some additional packages

  • Once R and RStudio are installed, launch RStudio. Either carefully type in or copy-and-paste the following lines of code at R’s command prompt, located in the RStudio window named “Console”, and then hit return. To copy this chunk of code, mouse over the code click the clipboard icon, , that appears in the top right corner of the chunk.
course_packages <- c("tidyverse", "babynames", "broom",
    "drat", "gapminder", "here", "janitor", "naniar", 
    "palmerpenguins", "skimr", "slider", "socviz",
    "usethis", "visdat","reprex")

install.packages(course_packages, repos = "http://cran.rstudio.com")

data_packages <- c("covdata", "congress", "nycdogs", 
                   "ukelection2019", "uscenpops")


Installing these packages may take a little time. Once you have completed this step, you’ll be ready to download the course packet and begin.

4. Optional step: get set up on GitHub

GitHub is a software development platform and service that is widely used by R contributors, as well as software developers in general. You can read some background on it from an R user’s point of view here.

If you do not have one already, it will be useful to create a GitHub account and obtain a GitHub Personal Access Token. This is not required for the course, but would be helpful to have. After you have installed R and RStudio, to get set up, read and carefully follow the instructions here:

Again, setting up a GitHub account is not required to fully participate in the course.