title: define target variable in glm r
body: <p>I want to be able to define my target variable 'def_target' outside the regression code below:</p>
  
  <pre><code>model1 &lt;- glm(def_target~., family=binomial(link='logit'),data=train70)
  </code></pre>
  
  <p>I have tried the following but get an error pop up</p>
  
  <pre><code>tv1 &lt;- 'def_target' 
  model1 &lt;- glm(tv1~., family=binomial(link='logit'),data=train70)
  </code></pre>
  
  <p>If anyone could help me that would be great.</p>
  
  <p>Thanks</p>