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.
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.
Open RStudio, it should look like the image below.
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)))
>
sign, before you hit enter it will look like this.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.
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.
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.
Author: Gordana Popovic
Last updated: 27 April, 2020