In this unit, you will learn how to add and modify basic plots, create functions and learn some programming tricks.
Follow the links to each lecture, lab, and reading.
Scroll down to download the SWIRL lessons.
SWIRL: Plotting More Data
Lab: Unit 5: Lab 1
Reading: Bestiary of Graphics
Lecture: Encoding values in color
SWIRL: Plotting Colours
Lab: Unit 5: Lab 2
Reading: Exporting graphics
Lecture: Writing your own functions
SWIRL: Writing functions
Lab: Unit 5: Lab 3
Reading: Best practice for writing R code
Lab: Unit 5: Lab 4
Reading: Crawley, M. The R Book Ch 2. Essentials of the R Language. 2.10 Loops and repeats
SWIRL: Sampling and simulation
Lab: Unit 5: Recap
Reading: Crawley, M. The R Book Ch 2. Essentials of the R Language. 2.9 Random numbers, shuffling, and sampling