title: transforming a transaction data to binary matrix format with R
body: <p>I have a transaction dataset like this:
  <a href="https://i.stack.imgur.com/71Ek2.png" rel="nofollow noreferrer">transaction data</a></p>
  
  <p>I used "arules" package to transform it to transaction data.</p>
  
  <p><code>transactions &lt;- read.csv("transactions.csv",header=TRUE,sep=",")
   agg &lt;- split(transactions$item,transactions$TransID)
   ready &lt;- as(agg,"transactions")</code>   </p>
  
  <p>Now I need a csv file on my desktop which is a binary matrix form: Transactions in the rows and items in the columns: 0 and 1 values in the matrix like this:  <a href="https://i.stack.imgur.com/RcHJC.png" rel="nofollow noreferrer">binary matrix format</a></p>
  
  <p>I used <em>write</em> function in the "<em>arules</em>" package but could not have it.</p>