title: R best fit of 45 degree line
body: <p>(i know it must be incredibely easy, but i'm strugling with it in R:)</p>
  
  <p>i have dataset of x and y values saved in X and Y vectors. I know that plot of the data should follow exactly -45 degree line (see image below)</p>
  
  <p><a href="https://i.stack.imgur.com/IUBq1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IUBq1.png" alt="enter image description here"></a></p>
  
  <p>How do i find such -45 degree line that best fits the data (+ all these statistics available from summary(lm(...))? I've tried lm, but i can't force it to abandon fitting the slope parameter</p>
  
  <p>Thank you</p>
  
  <p>After trying: <code>lm(y~1,offset=-x)</code> and applying <code>abline(coefficient, -1)</code> i obtain following plot (see below)
  <a href="https://i.stack.imgur.com/hqfTO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hqfTO.png" alt="enter image description here"></a></p>
  
  <p>black line is abline plot, yellow one is mine guess of fit -- what's wrong with <code>lm</code> or do i miss totally something?</p>