title: R: Limit/Set values of predicted results from linear model
body: <p>New to R.</p>
  
  <p>Looking to limit the range of values that can be predicted.</p>
  
  <pre><code>df.Train &lt;- data.frame(S=c(1,2,2,2,1),L=c(1,2,3,3,1),M=c(400,450,400,700,795),V=c(423,400,555,600,800),G=c(4,3.2,2,2.7,3.4), stringsAsFactors=FALSE)
  m.Train &lt;- lm(G~S+L+M+V,data=df.Train)
  df.Test &lt;- data.frame(S=c(1,2,1,2,1),L=c(1,2,3,1,1),M=c(400,450,500,800,795),V=c(423,475,555,600,555), stringsAsFactors=FALSE)
  round(predict(m.Train, df.Test, type="response"),digits=1)
  #seq(0,4,.1) #Predicted values should fall in this range
  </code></pre>
  
  <p>I've experimented with the predict()  options but no luck. 
  Is there an option in predict? Should I be limiting it in the model?</p>
  
  <p>Thank you</p>