I have the following plot in R. I would like to have a subplot in the existing plot form x =[0, 2]
and y=[0, 2]
, also I want to zoom into that subplot. How can I do this in R?
lin <- data.frame(x = c(0:6), y = c(0.3, 0.1, 0.9, 3.1, 5, 4.9, 6.2))
linm <- lm(y ~ x, data = lin, subset = 2:4)
plot(y ~ x, data = lin)
abline(linm)