Lecture materials
- April 6, Course introduction and getting started with R
- April 8, R objects, variable types and data tables
- April 13, Data visualisation with
ggplot
, part 1 - April 15, Data visualisation with
ggplot
, part 2 - April 20,
dplyr
: data manipulation and functions - April 22, Rmarkdown documents, presentations and workflow
- April 23, Project proposal due
- April 27, Pastes, merges and joins: combining tables and dataset grammar
- April 29, Useful tips, packages and FAQs
- May 7, Final project due
April 6, Course introduction and getting started with R
Before class
Install R, RStudio and
tidyverse
. You must do this before the session, as I will not devote lecture time to it! If you are having trouble, attend the office hours at 9am on April 7.Required reading: Variable types
Read through the showcase document. No need to study this in detail yet - the document briefly demonstrates most of the techniques that we'll cover in this class, so you'll know what to look forward to!
Materials
Lecture: slides, 2020 recording, 2021 recording
Extras
Showcase document: published and RMarkdown source
Data tables:
weather.csv
,rides.csv
April 8, R objects, variable types and data tables
Before class
Suggested reading: Summary statistics
Materials
Lecture: slides, 2020 recording, 2021 recording
Lab: Basic R objects
Extras
April 13, Data visualisation with ggplot
, part 1
Before class
Required reading: R for Data Science, chapter 3: Data visualisation, 2021 recording
Materials
Lecture: slides, 2020 recording, 2021 recording
Lab: Data visualization
Extras
Data tables:
worldbank_data_tidy.csv
Data sourced directly from world bank website:
worldbank_data_raw.csv
Script for tidying data table:
worldbank_ETL.R
Information about the raw data table:
worldbank_metadata.csv
April 15, Data visualisation with ggplot
, part 2
Note: Extras and "before class" from the previous lecture are also relevant to this one
Materials
Lecture: slides, 2020 recording, 2021 recording
Lab: Layering in
ggplot
April 20, dplyr
: data manipulation and functions
Before class
Required reading: R for Data Science, chapter 4: Data transformation
Materials
Lecture: slides, 2020 recording, 2021 recording
Lab: Data transformation
Extras
Data Wrangling cheat sheet (Note: this sheet uses
gather
andspread
, which are out-dated. We'll, talk about this sort of think in Lecture 7)
April 22, Rmarkdown documents, presentations and workflow
Before class
Instead of slides, this lecture will be conducted using two R Markdown documents, so download them and open them in RStudio before the lecture.
Materials
Lecture: introductory and advanced (this one needs to be modified before you will be able to compile it - figure out how!) R Markdown documents, and 2020 recording, 2021 recording
Extras
Data table:
airbnb_nyc_2019.csv
An in-depth guide to R Markdown: https://bookdown.org/yihui/rmarkdown/
April 23, Project proposal due
April 27, Pastes, merges and joins: combining tables and dataset grammar
Lecture: slides, 2020 recording, 2021 recording
Lab: Data joining and maps - this lab uses the following datsets:
Extras
Data table:
Drought_data.csv
Advanced mapping with R: Getting started with
ggmap
April 29, Useful tips, packages and FAQs
Materials
Lecture: slides, 2020 recording, 2021 recording
Lab: Data parsing and stat graphics - this lab uses the following datset:
Extras