title: R- Using arules sparse matrix output as input for another package?
body: <p>I used arules to build a sparse matrix out of transaction data and got some nice rules.  Now I'd like to use this matrix as an input for market basket analysis.  Apparently, the itemMatrix class can be coerced into ncGMatrix class for use in another package, but I'm not sure how. Any help would be appreciated.</p>
  
  <p>Original data had multiple items purchased from each customer (dwid)</p>
  
  <pre><code>dwid    Product.Colorblind
  310975  Candy
  310975  Fake doodie
  310975  House slippers
  310975  Canadian flags
  310975  Ham
  310990  Fake doodie
  310990  Candy
  310990  Turtle food
  </code></pre>
  
  <p>I read these in as transaction data and found some nice rules.</p>
  
  <pre><code>dataset &lt;- read.transactions(file="Just Colorblind.csv",format="single",sep=",",cols=c("dwid","Product.Colorblind"),rm.duplicates=TRUE)
  summary(dataset)
  itemFrequencyPlot(dataset, topN = 40)
  
  rules &lt;- apriori(data = dataset, parameter = list(minlen = 2, support = 0.005, confidence = 0.1))
  </code></pre>
  
  <p>Now, I'm just trying to make a sparse matrix out of the rules object</p>
  
  <pre><code>binary_activity_matrix &lt;- as(rules.itemMatrix, "ngCMatrix")
  </code></pre>
  
  <p>Any ideas?</p>