title: Adding item information to transaction object in arules
body: <p>I am using the <code>arules</code> package to find association rules in point-of-sale retail data. I am extracting transaction detail from a database, then placing in a <code>transaction</code> object. I'm new to <code>arules</code> and am trying to figure out how to populate the <code>itemInfo</code> data frame in the transaction object. Right now, I'm just bringing in the <code>transaction</code> and <code>item ID</code>s (both numeric), which provide little context. I would like to be able to add an item description, as well as product hierarchy levels.</p>
  
  <p>Below is the process I'm using today:</p>
  
  <ol>
  <li><p>Data comes through from the database in the below format:</p>
  
  <pre><code>Transaction_ID     Item_ID
  --------------     ----------- 
  100                1
  100                2
  100                3
  101                2
  101                3
  102                1
  102                2
  </code></pre></li>
  <li><p>To create the <code>transaction</code> object, I'm using the below command, as described in the <code>arules</code> documentation:</p>
  
  <pre><code>txdata &lt;- as(split(txdata[, "Item_ID"], txdata[, "Transaction_ID"]), "transactions")
  </code></pre>
  
  <p>Note: I've found that I need to have a numeric value for the <code>Item_ID</code>, otherwise I run into major performance issues using a string (due to poor performance of split when using factored strings).</p></li>
  <li><p>Create and view the association rules</p>
  
  <pre><code>rules &lt;- apriori(txdata, parameter = list(support=0.00015, confidence=0.5))
  inspect(head((sort(rules, by="confidence")), n=5))
  </code></pre></li>
  </ol>
  
  <p>When the rules come back, they are listed by <code>Item_ID</code>, which is not helpful to me. I want to be able to display them by the <code>ID</code> and/or description. Also, would like to take advantage of the aggregation features built into the <code>arules</code> package.</p>