Get started
In this course we will be using R and Rstudio. You can either
- (recommended) have R and Rstudio installed on your laptop
- or, use the PC in the PC lab here at the university
Watch these YouTube videos if you want a step-by-step guide.
Set up your RStudio on your laptop
You will need both R and Rstudio, they are two separate things.
You can download Rstudio here. In this page it will ask you to install R, so it should be clear to follow.
You can download R for Linux, macOS or Windows here or here
Once you have finished installing both R and Rstudio, open Rstudio, and you should be seeing something like this:
Data
You can download the datasets from either our GitHub repository, or Canvas.
Download data from Canvas
Log in your Canvas page, locate the dataset, and click “download”.
Download data from GitHub
The datasets used in this course are stored in this folder.
Go to the repository, select the data you want to download by left-click the file name
If it is a dataset in
.csv, .txt
format, you will see something like this
- find Raw button, right-click, you will see a list of options
- choose Download Linked File, this will download the data into your default download folder
- alternatively, choose Download linked file as… so that you can change where you put it and file name.
- If it is a dataset in
.dta, .xlsx
or other format, you might not see the data directly:
- find Download button, left-click, and you will download it into your default download folder.
Optional: download data via URL
If you feel like it, you can also download data inside R via URL. You can read more about it here.
Code
R scripts are stored in this folder.
To download an R script, it is similar to downloading a dataset
Alternatively, you can create your own R script locally inside Rstudio, by copy and paste the script from Github.