title: passing a string as a data frame column name
body: <p>I have a data frame called data.df with various columns say col1,col2,col3....col15. The data frame does not have a specific class attribute but any attribute could be potentially used as a class variable. I would like to use an R variable called target which points to the column number to be treated as class as follows :</p>
  
  <pre><code>target&lt;-data.df$col3
  </code></pre>
  
  <p>and then use  that field (target) as input to several learners such as PART and J48 (from package RWeka) : </p>
  
  <pre><code>part&lt;-PART(target~.,data=data.df,control=Weka_control(M=200,R=FALSE))
  j48&lt;-J48(target~.,data=data.df,control=Weka_control(M=200,R=FALSE)) 
  </code></pre>
  
  <p>The idea is to be able to change 'target' only once at the beginning of my R code.  How can this be done?</p>