Exercise 1: Define x and y vectors as below

set.seed(123523458)
x <- 1:10
y <- sample(x)

and plot y as a function of x.

plot(x, y)


Exercise 2: Make a linear model y as a function of x.

model <- lm(y ~ x)


Exercise 3: Make a plot of y as a function of x, together with the linear model

plot(x, y)
abline(model)