title: Error in contrasts when defining a linear model in R
body: <p>When I try to define my linear model in R as follows:</p>
  
  <pre><code>lm1 &lt;- lm(predictorvariable ~ x1+x2+x3, data=dataframe.df)
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>Error in `contrasts&lt;-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : 
  contrasts can be applied only to factors with 2 or more levels 
  </code></pre>
  
  <p>Is there any way to ignore this or fix it? Some of the variables are factors and some are not.</p>