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.
Code
course_packages <- c("tidyverse", "babynames", "broom",
    "gapminder", "here", "janitor", "naniar", 
    "palmerpenguins", "skimr", "slider", "socviz",
    "usethis", "visdat","reprex", "remotes")

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

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


remotes::install_github(data_packages)

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