We are going to be covering a lot in our R sessions, so to give us a jump start, I’ve compiled some things you should have done before coming:

  1. Run through 1+ RStudio R primers
  2. Install R (Update R)
  3. Install RStudio (Update RStudio)
  4. Install tidyverse packages (Update tidyverse packages)
  5. Install a couple of extra packages

IMPORTANT!:
If you have any problems installing the software or packages, please contact me before class so we can sort out any problems


Instructions

1. Run through 1+ RStudio R primers

Please complete the RStudio Programming Basics Primer.

You can complete it online and it’ll give you a quick introduction to R coding which is will be a great way to get up to speed on the basics before we jump in.

Feel free to run through other RStudio Primers.

2. Install R (Update R)

Even if you already have R installed, please update it, so we’re all working with the same version

Depending on your operating system, you can install R in one of the following ways:

Windows

Mac

Linux: Debian/Ubuntu

3. Install RStudio

Even if you already have RStudio installed, please update it, so we’re all working with the same version

Open RStudio RStudio Logo not R R Logo. RStudio automatically opens R for you in the ‘Console’ pane

Verify that your version of R by looking at the first line of the console (left or lower left pane), you should see something like this:

## R version 4.1.2 (2021-11-01) -- Bird Hippie
## Copyright (C) 2021 The R Foundation for Statistical Computing
## Platform: x86_64-pc-linux-gnu (64-bit)
## 
## R is free software and comes with ABSOLUTELY NO WARRANTY.
## You are welcome to redistribute it under certain conditions.
## Type 'license()' or 'licence()' for distribution details.
## 
##   Natural language support but running in an English locale
## 
## R is a collaborative project with many contributors.
## Type 'contributors()' for more information and
## 'citation()' on how to cite R or R packages in publications.
## 
## Type 'demo()' for some demos, 'help()' for on-line help, or
## 'help.start()' for an HTML browser interface to help.
## Type 'q()' to quit R.

The important line is the first one: R version 4.1.2 (2021-11-01) – Bird Hippie

4a) Install tidyverse package

Packages are extensions or add-ons for R. You will use many different ones over the course of your work with R. tidyverse is name of a collection of newer packages for data management.

In RStudio:

  • Click on the ‘Packages’ tab in the lower right hand corner
  • Click on the ‘Install’ button right below the tab
  • Type ‘tidyverse’ into the ‘Packages’ box, and click on ‘Install’

RStudio Packages Tab

  • This may take a while (you will see lots of download text in red in your console)
  • When it’s finished, you should see a message similar this one to in the console (lower left hand pane)
* DONE (tidyverse)

The downloaded source packages are in
    ‘/tmp/RtmpACWq9S/downloaded_packages’
> 
  • Test that your installation had no problems by typing library("tidyverse") into the console and hitting enter. You should see something like this (Note: These are messages, not errors!):
library("tidyverse")

Problems?

  • If you already had R/RStudio installed, try removing them both and installing everything from scratch
  • If you get an error about a problem installing a specific package, try installing that package invidiually (search for it in the install packages menu)
  • Try installing the packages we need by hand: dplyr, tidyr, readr, ggplot2, skimr
  • Contact Steffi

4b) Update tidyverse

This is only necessary if you already have a version of tidyverse installed.

In RStudio:

  • Click on on the ‘Update’ button next to the ‘Install’ button
  • Click on ‘Select All’ button
  • Click on ‘Install Updates’ button
  • Repeat until there are no new updates

5. Install some other packages

We’ll also be using a couple of other packages that are not included in the tidyverse so let’s make sure you have them installed. We will be using more packages than this, but this will get you ready for the first labs.

  • palmerpenguins
  • janitor
  • readxl

You can install them the same way you installed tidyverse

OR you can use the command line and type the following into the console:

install.packages(c("palmerpenguins", "janitor", "readxl"))

Congratulations! Now you’re ready to get into the fun stuff :)