title: R-convert transaction format dataset to basket format for Market Basket Analysis
body: <p>First I would like to clarify that before posting this query, I have referred the following links in this site to find answer, but couldn't understand, maybe because they address different problems or because I am new to R. </p>
  
  <p><a href="https://stackoverflow.com/questions/21495832/r-convert-transaction-format-dataset-to-basket-format-for-sequence-mining">R-convert transaction format dataset to basket format for sequence mining</a></p>
  
  <p><a href="https://stackoverflow.com/questions/13022102/arules-sequence-mining-in-r">Arules Sequence Mining in R</a></p>
  
  <p><a href="https://stackoverflow.com/questions/11692349/how-to-handle-argument-incomparables-false-is-not-used-yet">How to handle &quot;argument &#39;incomparables != FALSE&#39; is not used (yet)&quot;?</a></p>
  
  <p>I want to do Market Basket Analysis with my dataset. My dataset is in transaction format (as described below) and I want to convert it to Basket format (as described below).</p>
  
  <p>My input file is a csv file with dataset in transaction format as follows:</p>
  
  <pre><code>TransactionID ProductID
  A              1
  A              2
  B              1
  C              3
  A              4
  B              3
  </code></pre>
  
  <p>I want my output file to be a csv file with Basket format as follows:</p>
  
  <pre><code>1 2 4
  1 3
  3
  </code></pre>
  
  <p>where {1,2,4} are products bought in transaction A, {1,3} bought in B and so on.</p>
  
  <p>Can you please tell me the R code to do this? I tried with the following code but it is not working.My input file name is "D01_modified1.csv".</p>
  
  <pre><code>library(arulesSequences)
  # Read CSV into R
  MyData &lt;- read.csv(file="D01_modified1.csv", header=TRUE, sep=",")
  s &lt;- unique(MyData,incomparables = FALSE, fromLast = FALSE,paste0("ProductID"))
  # Write CSV in R
  write.csv(s, file = "MyOutput.csv",row.names=FALSE, na="")
  </code></pre>
  
  <p>It is giving the following error : </p>
  
  <pre><code>Error: argument 'incomparables != FALSE' is not used (yet)
  </code></pre>
  
  <p>Also I am not sure if the following code will give me the desired output or not. </p>
  
  <pre><code>s &lt;- unique(MyData,incomparables = FALSE, fromLast = FALSE,paste0("ProductID"))
  </code></pre>
  
  <p>Please guide. Looking forward to your help. Thanks a lot... </p>