1 Create an R project

File -> New Project

Click on New Directory

Click on New Project

This will set up an RStudio project in a new directory called slr_practical1 on the Desktop of your machine, and launch a new session of R in Rstudio. Your screen should look something like this.

2 Installing Packages

2.1 Method 1

2.2 Method 2

install.packages("ggplot2")

3 Create an R Markdown document

File -> New File -> R Markdown

4 Create a small dataset

x <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
y <- c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
df <- data.frame(x=x, y=y)
df
    x   y
1   1  10
2   2  20
3   3  30
4   4  40
5   5  50
6   6  60
7   7  70
8   8  80
9   9  90
10 10 100