I have the following dataset:

```
x <- 1:5
y <- c(1, 2, 1.3, 3.75, 2.25)

```

And I need to draw the straight line that fits my dataset by using simple regression, as well as these points:

```
plot(x, y, pch=19, ylim=c(0,6))
xx <- seq(0, 6, length=100)
fit <- lm(y~x)
lines(xx, predict(fit, data.frame(x=xx)))

```

Now I would like to join the points in the plot to the line as in the following (example) picture, showing the related prediction error:

[![enter image description here](https://i.stack.imgur.com/0zfzr.png)](https://i.stack.imgur.com/0zfzr.png)

How can I do?