We need to install two things onto your computer. The first is R, this is the programming language we will use. After that we need to install RStudio, this is a front end program that lets you write R code, view plots, and do many other useful things.

If you have a previous installation of R and RStudio, that you have not used much, please remove these first from your computer, and download the current versions as per the instructions below.

Install R

  1. Download the R installer from https://cran.r-project.org/.
  1. Click on the link for your operating system. Make sure the installer is for R version 4.0.0.

  1. Click install R for the first time.

  1. Use the download link at the top and save the file.

  1. Run the installer (double click), default settings are fine. If you do not have admin rights on your laptop, then ask IT. If this is the case, it is important to ask them to give you full permissions to the R directories. Without this you will not be able to install packages. If there is any other problem, we can help you sort it out at the pre-course Zoom checks.

Install RStudio

  1. Wait until the R installer has finished
  2. Download RStudio https://rstudio.com/products/rstudio/download/#download.

The page should recommend the right file based on your system, if not scroll for all the options. If you are having trouble, we can help you sort it out at the pre-course Zoom checks.

Check R and RStudio are working

  1. Open RStudio, it should look like the image below.

  2. We are going to try to run the following code, follow instructions below.

install.packages("ggplot2")
library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg))
p + geom_point(aes(size = qsec, colour = factor(cyl)))
  1. Copy the code above and paste it in the Console window in R studio, by the > sign, before you hit enter it will look like this.

  1. Hit enter, the code will run, and there will be a plot will be created in the plot window on the right.

If you have a plot similar to mine, all is well, you have installed R and RStudio. You will still need to come to the pre-course Zoom chat just to check your setup, but it will be super quick. If there are any snags, we can chat about it then.

Set up your screen

Setting up your screen well from the start will help get you coding fast, we strongly recommend you try the setups recommended below. The lessons look a lot like RStudio, and it is easy to get confused between your own code and the lesson code. To differentiate the two visually we recommend you change your RStudio theme to something with a dark background.

  1. In RStudio go to Tools > Global Options
  2. Choose ‘Appearance’
  3. Under ‘Editor theme’ chose ‘Idle Fingers’ (or another dark theme)

If you have dual monitors, you’re all set, put RStudio on one and everything else on the other. If you have a single monitor, then you need to be a little more organised.

  1. Put RStudio on the left half of your monitor
  2. Inside RStudio, grab the vertical bar between the Console and the Files/Plot windows and squish it to the right, until you mostly just see the Console.
  3. Put Zoom in the top left corner, taking up about a third of the vertical space. Sometimes I will ask you to go full screen on Zoom, practice going from full screen to top right corner.
  4. Put your browser in the bottom right, taking up the other two thirds of the vertical space.

Author: Gordana Popovic

Last updated: 27 April, 2020