This is a worksheet for use with Lecture 1.
You should have installed R and RStudio on your own machine (see course manual) or on the PCs in either the common room or the postgrad. teaching room.
You have a videos of me narrating these slides. Note that there are minor discrepancies between the current set of slides and the one in the video. The slide numbers refer to the current set. I do not cover every single slide but you can code along!
If you answer correctly the colour of the box will change from red dashed to full blue!
Work through the markdown tutorial. You don't have to complete it in its entirety, getting up to 'Lists' is the most important. (You will likely never need block quotes in lists... . You can see me doing an attempt in this video.
Follow the steps and make a web page in RStudio.
Open in browser, and save as a .pdf.
Run current chunk is the play button
See my cursor.
Should display today's date. (Or in my case when I made this script)
Sys.Date()
## [1] "2024-01-18"
Proceed to install the 'ggplot2' package. (Or another package if you feel adventurous).
See my cursor. First click install and then install packages. It'll autocomplete, neat!
You can either remove 'Sysdate' from that previous chunk you made or make a new chunk (Code --> Insert Chunk).
See my cursor. First click install and then install packages. It'll autocomplete, neat!
Next you need to load it. You can also use require()
library(ggplot2) # loads package
You can check this if you want by using the command line in the console window or again using chunks.
See my cursor. I have calculated 2+2. Note how the console is a different window - here we are 'directly' talking to R.