title: Plot fitted line within certain range R
body: <p>Using R, I would like to plot a linear relationship between two variables, but I would like the fitted line to be present only within the range of the data.</p>
  
  <p>For example, if I have the following code, I would like the line to exist only from x and y values of 1:10 (with default parameters this line extends beyond the range of data points).</p>
  
  <pre><code>x &lt;- 1:10
  y &lt;- 1:10
  plot(x,y)
  abline(lm(y~x))
  </code></pre>