title: How to set attributes for a variable in R?
body: <p>How do I assign an attribute to a variable? For eg. </p>
  
  <pre><code>&gt; x &lt;- rpart(f.la, mydata) 
  </code></pre>
  
  <p>assigns the attributes:</p>
  
  <pre><code>$names
  [1] "frame"               "where"              
  [3] "call"                "terms"              
  [5] "cptable"             "method"             
  [7] "parms"               "control"            
  [9] "functions"           "numresp"            
  [11] "splits"              "variable.importance"
  [13] "y"                   "ordered"            
  
  $xlevels
  named list()
  
  $ylevels
  [1] "cancelled"    "cart-abandon" "purchased"    "returned"    
  
  $class
  [1] "rpart"
  </code></pre>
  
  <p>Like this, I want to create attributes for a variable and assign a value to that attribute.</p>