title: How LINFIT in IDL is represented in R?
body: <p>I have a code written in IDL that I want to convert to R.</p>
  
  <p>within the code I found this function:</p>
  
  <pre><code>result  = linfit(dum_x, dum_y) 
   y_a= result[0]
   y_b= result[1]
             "LINFIT function" which fits the paired data { xi , yi } to the linear model, y = A + Bx, 
                 by minimizing the Chi-square error statistic
  </code></pre>
  
  <p>I wonder if there is a similar function in R? Any ideas
  How  we can convert this line to R :</p>
  
  <pre><code>       y_a= result[0]   
  </code></pre>