R Error in terms.formula(formula, data = data) : invalid term in model formula
<p>Using the code </p>

<pre><code>formula = formula(paste(x, "~", y, sep=""))
model&lt;-(lm(formula))
</code></pre>

<p>I got the following error:</p>

<blockquote>
  <p>Error in terms.formula(formula, data = data) : invalid term in model formula</p>
</blockquote>

<p>I would like to keep <code>formula(paste)</code> because x and y are num[1:82].</p>