title: How to get trendline equations in R
body: <p>i have a series of data in form of time and temperature value. I want to generate a trendline and find the subsequent equation. This could be done in excel. but, how could i find equation of the trendline in R. </p>
  
  <p>abline function can be used to generate a trendline but where is the underlying equation?? I saw a link where they have used the following code to illustrate the issue</p>
  
  <pre><code>x &lt;- sample(1:100, 100, replace = TRUE)
  
  y &lt;- x + rnorm(100, sd = 4)
  mydf &lt;- data.frame(x = x, y = y)
  plot(y ~ x, data = mydf)
  model &lt;- lm(y ~ x, data = mydf)
  abline(model, col = "red")
  summary(model)
  </code></pre>
  
  <p>if you execute it, can make some sense of the result and see the equation, please let me know. else help me to get equation of trendlines with R</p>
  
  <p>Thanks!</p>