title: How to predict single values in R
body: <p>I have a linear regression model with two variables meanValuesHeatingPower and meanValuesOutsideTemperature that both have 365 entries. Now I want to use this linear model to predict only 1 value (in this case this value is 1)). If I use the following code, the desired value in not printed but 365 values. Furthermore I get the error message:
  "Warning message:
  'newdata' had 1 row but variables found have 365 rows "</p>
  
  <pre><code>linearModel&lt;-lm(meanValuesHeatingPower~meanValuesOutsideTemperature)
      pred&lt;-predict(linearModel, data.frame(train_x = c(1)))
      print(pred)
  </code></pre>
  
  <p>What I want is quite simple. With the regression I get a linear function:
  y(x)=mx+c and I want to calculate the value of the function for x=1.</p>
  
  <p>How can I get that value?</p>